From 694a0d732be8c71fa5d4c421ac3316b2875cea38 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 9 May 2008 02:14:27 +0000 Subject: [PATCH] converted a bunch of tex-isms to scribble-isms and other small improvements in the docs svn: r9760 --- collects/drscheme/private/ts.ss | 12 + collects/drscheme/tool-lib.ss | 566 +++++++++++-------------- collects/scribble/srcdoc.ss | 17 + collects/scribblings/tools/tools.scrbl | 2 +- 4 files changed, 283 insertions(+), 314 deletions(-) create mode 100644 collects/drscheme/private/ts.ss diff --git a/collects/drscheme/private/ts.ss b/collects/drscheme/private/ts.ss new file mode 100644 index 0000000000..e1d6de5dc8 --- /dev/null +++ b/collects/drscheme/private/ts.ss @@ -0,0 +1,12 @@ +#reader scribble/reader +#lang scheme/base + +(require scribble/decode + scribble/manual) + +(define (phase n) + (make-splice + @list{This function can only be called in + phase @(number->string n) (see @secref["implementing-tools"] for details).})) + +(provide phase) diff --git a/collects/drscheme/tool-lib.ss b/collects/drscheme/tool-lib.ss index 9fc8551a19..785a129be3 100644 --- a/collects/drscheme/tool-lib.ss +++ b/collects/drscheme/tool-lib.ss @@ -1,3 +1,5 @@ +#reader scribble/reader +#lang scheme/base #| @@ -6,8 +8,6 @@ the main unit, starting up drscheme. After that, it just provides all of the names in the tools library, for use defining keybindings |# -#reader scribble/reader -#lang scheme/base (require drscheme/private/link drscheme/private/drsig scheme/class @@ -16,73 +16,27 @@ all of the names in the tools library, for use defining keybindings framework scribble/srcdoc framework/splash - scheme/contract) + scheme/contract + drscheme/private/oc) (require (for-syntax scheme/base)) -(require/doc scheme/base scribble/manual) +(require/doc drscheme/private/ts drscheme/private/oc scheme/base scribble/manual) - (shutdown-splash) - (define-values/invoke-unit/infer drscheme@) - (close-splash) - (provide-signature-elements drscheme:tool-cm^) ;; provide all of the classes & interfaces - - (provide drscheme:unit:program-editor-mixin) - (define-syntax (drscheme:unit:program-editor-mixin stx) - (syntax-case stx () - [(_ a ...) - #'((drscheme:unit:get-program-editor-mixin) a ...)] - [_ #'(drscheme:unit:get-program-editor-mixin)])) +(shutdown-splash) +(define-values/invoke-unit/infer drscheme@) +(close-splash) +(provide-signature-elements drscheme:tool-cm^) ;; provide all of the classes & interfaces + +(provide drscheme:unit:program-editor-mixin) +(define-syntax (drscheme:unit:program-editor-mixin stx) + (syntax-case stx () + [(_ a ...) + #'((drscheme:unit:get-program-editor-mixin) a ...)] + [_ #'(drscheme:unit:get-program-editor-mixin)])) -(define language-object - (object-contract - (config-panel ((is-a?/c area-container<%>) - . -> . - (case-> (any/c . -> . void?) (-> any/c)))) - (create-executable (any/c - (or/c (is-a?/c dialog%) (is-a?/c frame%)) - path? - . -> . - void?)) - (default-settings (-> any/c)) - (default-settings? (any/c . -> . boolean?)) - (order-manuals ((listof bytes?) . -> . (values (listof bytes?) boolean?))) - (front-end/complete-program (input-port? - any/c - . -> . - (-> any/c))) - (front-end/interaction (input-port? - any/c - . -> . - (-> any/c))) - (get-language-name (-> string?)) - (get-language-numbers (-> (cons/c number? (listof number?)))) - (get-language-position (-> (cons/c string? (listof string?)))) - (get-language-url (-> (or/c false/c string?))) - (get-one-line-summary (-> string?)) - (get-comment-character (-> (values string? char?))) - (get-style-delta (-> (or/c false/c - (is-a?/c style-delta%) - (listof (list/c (is-a?/c style-delta%) number? number?))))) - (marshall-settings (any/c . -> . printable/c)) - (on-execute (any/c ((-> any) . -> . any) . -> . any)) - (render-value (any/c - any/c - output-port? - . -> . - void?)) - (render-value/format (any/c - any/c - output-port? - (or/c number? (symbols 'infinity)) - . -> . - any)) - (unmarshall-settings (printable/c . -> . any)) - (capability-value - (->d ([s (and/c symbol? drscheme:language:capability-registered?)]) - () - [res (drscheme:language:get-capability-contract s)])))) - +(define drscheme:language:object/c (oc here)) + (provide/doc ; @@ -108,39 +62,39 @@ all of the names in the tools library, for use defining keybindings (-> (listof (is-a?/c snip-class%)) void?) (snipclasses) @{sets the parameters that are shared between the repl's - initialization and \\iscmprocedure{drscheme:eval:build-user-eventspace/custodian} + initialization and @scheme[drscheme:eval:build-user-eventspace/custodian] Specifically, it sets these parameters: - \\begin{itemize} - \\item \\rawscm{current-namespace} has been set to a newly + @itemize{ + @item{ @scheme[current-namespace] has been set to a newly created empty namespace. This namespace has the following modules - copied (with \\MzLink{mz:namespace-utilities}{\\rawscm{namespace-attach-module}}) + copied (with @scheme[namespace-attach-module]) from DrScheme's original namespace: - \\begin{itemize} - \\item \\Symbol{mzscheme} - \\item \\scmc{'(lib \"mred.ss\" \"mred\")} - \\end{itemize} + @itemize{ + @item{ @scheme['mzscheme] + }@item{ @scheme['(lib "mred.ss" "mred")] + }} - \\item - \\MzLink{mz:p:read-curly-brace-as-paren}{\\rawscm{read-curly-brace-as-paren}} - is \\scmc{\\#t}, - \\item - \\MzLink{mz:p:read-square-bracket-as-paren}{\\rawscm{read-square-bracket-as-paren}} - is \\scmc{\\#t}, - \\item - \\MzLink{mz:p:error-print-width}{\\rawscm{error-print-width}} is set to 250. - \\item - @scheme[flink current-ps-setup] + }@item{ + @scheme[read-curly-brace-as-paren] + is @scheme[#t], + }@item{ + @scheme[read-square-bracket-as-paren] + is @scheme[#t], + }@item{ + @scheme[error-print-width] is set to 250. + }@item{ + @scheme[current-ps-setup] is set to a newly created @scheme[ps-setup%] object. - \\item The \\MzLink{mz:p:exit-handler}{\\rawscm{exit-handler}} is set to + }@item{ The @scheme[exit-handler] is set to a parameter that kills the user's custodian. - \\item The snip-class-list, returned by - @scheme[flink get-the-snip-class-list] + }@item{ The snip-class-list, returned by + @scheme[get-the-snip-class-list] is initialized with all of the snipclasses in DrScheme's eventspace's snip-class-list. - \\end{itemize}}) + }}}) (proc-doc/names drscheme:eval:get-snip-classes @@ -167,51 +121,49 @@ all of the names in the tools library, for use defining keybindings window for use with external program processing tools. This function uses - @scheme[flink drscheme:eval:build-user-eventspace/custodian] + @scheme[drscheme:eval:build-user-eventspace/custodian] to build the user's environment. - The arguments \\var{language-settings}, \\var{init}, and - \\var{kill-termination} are passed to - @scheme[flink drscheme:eval:build-user-eventspace/custodian] % - . + The arguments @scheme[language-settings], @scheme[init], and + @scheme[kill-termination] are passed to + @scheme[drscheme:eval:build-user-eventspace/custodian]. - The \\var{input} argument specifies the source of the program. + The @scheme[input] argument specifies the source of the program. - The \\var{eval-compile-time-part?} argument indicates if - \\Mzhyperref{\\rawscm{expand}}{mz:expansion} + The @scheme[eval-compile-time-part?] argument indicates if + @scheme[expand] is called or if - \\scheme|expand-top-level-with-compile-time-evals| + @scheme[expand-top-level-with-compile-time-evals] is called when the program is expanded. Roughly speaking, if your tool will evaluate each expression itself by calling - \\Mzhyperref{\\rawscm{eval}}{mz:evalload} - then pass \\scheme{#f}. Otherwise, if your tool + @scheme[eval] + then pass @scheme[#f]. Otherwise, if your tool just processes the expanded program, be sure to pass - \\scheme{#t}. + @scheme[#t]. This function calls @scheme[drscheme:language:language front-end/complete-program<%>] to expand the program. - The first argument to \\var{iter} is the expanded program + The first argument to @scheme[iter] is the expanded program (represented as syntax) or eof. - The \\var{iter} argument is called for each expression in the + The @scheme[iter] argument is called for each expression in the expanded program and once more with eof, unless an error is raised during expansion. It is called from the user's thread. If an exception is raised during expansion of the - user's program, \\var{iter} is not called. - Consider setting the exception-handler during \\var{init} to + user's program, @scheme[iter] is not called. + Consider setting the exception-handler during @scheme[init] to handle this situation. - The second argument to \\var{iter} is a thunk that + The second argument to @scheme[iter] is a thunk that continues expanding the rest of the contents of the - definitions window. If the first argument to \\var{iter} was + definitions window. If the first argument to @scheme[iter] was eof, this argument is just the primitive - \\rawscm{void}. + @scheme[void]. See also - @scheme[flink drscheme:eval:expand-program/multiple] % - .}) + @scheme[drscheme:eval:expand-program/multiple].}) (proc-doc/names drscheme:eval:traverse-program/multiple @@ -230,7 +182,7 @@ all of the names in the tools library, for use defining keybindings (language-settings init kill-termination) @{This function is similar to - @scheme[flink drscheme:eval:expand-program/multiple] + @scheme[drscheme:eval:expand-program/multiple] The only difference is that it does not expand the program in the editor; instead the processing function can decide how to @@ -251,7 +203,7 @@ all of the names in the tools library, for use defining keybindings (language-settings eval-compile-time-part? init kill-termination) @{This function is just like - @scheme[flink drscheme:eval:expand-program] + @scheme[drscheme:eval:expand-program] except that it is curried and the second application can be used multiple times. Use this function if you want to initialize the user's @@ -277,51 +229,50 @@ all of the names in the tools library, for use defining keybindings @{This function creates a custodian and an eventspace (on the new custodian) to expand the user's program. It does not kill this custodian, but it can safely be shutdown (with - \\MzLink{mz:custodians}{custodian-shutdown-all}) after the + @scheme[custodian-shutdown-all]) after the expansion is finished. It initializes the user's eventspace's main thread with several parameters: - \\begin{itemize} - \\item \\rawscm{current-custodian} is set to a new custodian. - \\item + @itemize{ + @item{ @scheme[current-custodian] is set to a new custodian. + }@item{ In addition, it calls - @scheme[flink drscheme:eval:set-basic-parameters] % - . - \\end{itemize} + @scheme[drscheme:eval:set-basic-parameters]. + }} - The \\var{language-settings} argument is the current + The @scheme[language-settings] argument is the current language and its settings. See - @scheme[flink drscheme:language-configuration:make-language-settings] + @scheme[drscheme:language-configuration:make-language-settings] for details on that structure. If the program is associated with a DrScheme frame, get the frame's language settings from the - @scheme[drscheme:unit:definitions-text get-next-settings<%>] + @method[drscheme:unit:definitions-text<%> get-next-settings] method of @scheme[drscheme:unit:definitions-text<%>]. Also, the most recently chosen language in the language dialog is saved via the framework's preferences. Apply - @scheme[flink preferences:get] + @scheme[preferences:get] to - @scheme[flink drscheme:language-configuration:get-settings-preferences-symbol] - for that \\var{language-settings}. + @scheme[drscheme:language-configuration:get-settings-preferences-symbol] + for that @scheme[language-settings]. - The \\var{init} argument is called after the user's parameters + The @scheme[init] argument is called after the user's parameters are all set, but before the program is run. It is called on the user's thread. The - \\MzLink{mz:p:current-directory}{current-directory} and - \\MzLink{mz:p:current-load-relative-directory}{current-load-relative-directory} + @scheme[current-directory] and + @scheme[current-load-relative-directory] parameters are not set, so if there are appropriate directories, - the \\var{init} argument is a good place to set them. + the @scheme[init] argument is a good place to set them. - The \\var{kill-termination} argument is called when the main thread of + The @scheme[kill-termination] argument is called when the main thread of the eventspace terminates, no matter if the custodian was shutdown, or the thread was killed. This procedure is also called when the thread terminates normally. This procedure is - called from a new, dedicated thread ({\\it i. e.}, not the thread + called from a new, dedicated thread (@italic{i. e.}, not the thread created to do the expansion, nor the thread that - \\rawscm{drscheme:eval:build-user-eventspace/custodian} was called from.)}) + @scheme[drscheme:eval:build-user-eventspace/custodian] was called from.)}) @@ -344,24 +295,22 @@ all of the names in the tools library, for use defining keybindings (proc-doc/names drscheme:debug:show-error-and-highlight - (string? - (or/c any/c exn?) - (-> (listof srcloc?) (or/c false/c (listof (list/c (is-a?/c text%) number? number?))) any) - . -> . - any) + (-> string? + (or/c any/c exn?) + (-> (listof srcloc?) (or/c false/c (listof (list/c (is-a?/c text%) number? number?))) any) + any) (msg exn highlight-errors) @{The first two arguments are the same as the arguments to the error-display-handler. This function prints the error message to the current-error-port, like the default error-display-handler - and also calls \\var{highlight-errors} to do error highlighting. It is be passed the stack trace + and also calls @scheme[highlight-errors] to do error highlighting. It is be passed the stack trace for the error message. This function should be called on the same thread/eventspace where the error happened.}) (proc-doc/names drscheme:debug:make-debug-error-display-handler - ((string? (or/c any/c exn?) . -> . any) - . -> . - (string? (or/c any/c exn?) . -> . any)) + (-> (-> string? (or/c any/c exn?) any) + (-> string? (or/c any/c exn?) any)) (oedh) @@ -369,8 +318,7 @@ all of the names in the tools library, for use defining keybindings of another error-display-handler. This function is designed to work in conjunction with - @scheme[flink drscheme:debug:make-debug-eval-handler] % - . + @scheme[drscheme:debug:make-debug-eval-handler]. See also MzScheme's MzLink{mz:p:error-display-handler}{error-display-handler} @@ -378,7 +326,7 @@ all of the names in the tools library, for use defining keybindings If the current-error-port is the definitions window in drscheme, this error handler inserts some debugging - annotations, calls \\var{oedh}, and then highlights the + annotations, calls @scheme[oedh], and then highlights the source location of the runtime error.}) (proc-doc/names @@ -393,8 +341,7 @@ all of the names in the tools library, for use defining keybindings eval-handler. This function is designed to work in conjunction with - @scheme[flink drscheme:debug:make-debug-error-display-handler] % - . + @scheme[drscheme:debug:make-debug-error-display-handler]. See also MzScheme's MzLink{mz:p:eval-handler}{eval-handler} parameter. @@ -418,10 +365,10 @@ all of the names in the tools library, for use defining keybindings ((enabled?) ()) @{A parameter that controls if profiling information is recorded. - Defaults to \\scmc{\\#f}. + Defaults to @scheme[#f]. Only applies if - @scheme[flink drscheme:debug:make-debug-eval-handler] + @scheme[drscheme:debug:make-debug-eval-handler] has been added to the eval handler.}) (proc-doc/names @@ -435,14 +382,13 @@ all of the names in the tools library, for use defining keybindings (srcloc? . -> . void?) (debug-info) @{This function opens a DrScheme to display - \\var{debug-info}. The first element in + @scheme[debug-info]. The first element in the cons indicates where the file is and the two number indicate a range of text to show. See also - @scheme[flink drscheme:debug:get-cm-key] % - .}) + @scheme[drscheme:debug:get-cm-key].}) (proc-doc/names drscheme:debug:show-backtrace-window @@ -454,17 +400,16 @@ all of the names in the tools library, for use defining keybindings @{Shows the backtrace window you get when clicking on the bug in DrScheme's REPL. - The \\var{error-message} argument is the text of the error, - \\var{dis} is the debug information, extracted from the + The @scheme[error-message] argument is the text of the error, + @scheme[dis] is the debug information, extracted from the continuation mark in the exception record, using - @scheme[flink drscheme:debug:get-cm-key] % - .}) + @scheme[drscheme:debug:get-cm-key].}) (proc-doc/names drscheme:debug:get-cm-key (-> any) () - @{Returns a key used with \\scheme|contination-mark-set->list|. + @{Returns a key used with @scheme[contination-mark-set->list]. The contination mark set attached to an exception record for the user's program may use this mark. If it does, each mark on the continuation is a list of the fields @@ -493,23 +438,21 @@ all of the names in the tools library, for use defining keybindings (-> ((subclass?/c text%) . -> . (subclass?/c text%))) () @{Returns a mixin that must be mixed in to any - \\iscmclass{text} object that might contain + @scheme[text%] object that might contain program text (and thus can be in the source field of some syntax object). See also - @scheme[flink drscheme:unit:add-to-program-editor-mixin] % - .}) + @scheme[drscheme:unit:add-to-program-editor-mixin].}) (proc-doc/names drscheme:unit:add-to-program-editor-mixin (((subclass?/c text%) . -> . (subclass?/c text%)) . -> . void?) (mixin) - @{\\phase{1} + @{@phase[1] - Adds \\var{mixin} to the result of - @scheme[flink drscheme:unit:get-program-editor-mixin] % - .}) + Adds @scheme[mixin] to the result of + @scheme[drscheme:unit:get-program-editor-mixin].}) (proc-doc/names drscheme:unit:open-drscheme-window @@ -518,8 +461,8 @@ all of the names in the tools library, for use defining keybindings ((or/c string? false/c) . -> . (is-a?/c drscheme:unit:frame%))) (() (filename)) - @{Opens a drscheme frame that displays \\var{filename}, - or nothing if \\var{filename} is \\scmc{\\#f} or not supplied.}) + @{Opens a drscheme frame that displays @scheme[filename], + or nothing if @scheme[filename] is @scheme[#f] or not supplied.}) @@ -553,30 +496,30 @@ all of the names in the tools library, for use defining keybindings @{Adds a mode to DrScheme. Returns a mode value that identifies the mode. - The first argument, \\var{name}, is the name + The first argument, @scheme[name], is the name of the mode, used in DrScheme's GUI to allow the user to select this mode. - The \\var{surrogate} argument is set to the + The @scheme[surrogate] argument is set to the definitions text and the interactions text (via the @scheme[mode:host-text set-surrogate<%>] method) whenever this mode is enabled. - The \\var{repl-submit} procedure is called + The @scheme[repl-submit] procedure is called whenever the user types a return in the interactions window. It is passed the interactions editor and the position where the last prompt occurs. If it - returns \\scheme|#t|, the text after the last + returns @scheme[#t], the text after the last prompt is treated as a program fragment and evaluated, according to the language settings. - If it returns \\scheme|#f|, the text is + If it returns @scheme[#f], the text is assumed to be an incomplete program fragment, and the keystroke is not treated specially. - The \\var{matches-language} predicate is called whenever - the language changes. If it returns \\scheme|#t| + The @scheme[matches-language] predicate is called whenever + the language changes. If it returns @scheme[#t] this mode is installed. It is passed the list of strings that correspond to the names of the language in the language dialog. @@ -587,14 +530,13 @@ all of the names in the tools library, for use defining keybindings changes. See also - @scheme[flink drscheme:modes:get-modes] % - .}) + @scheme[drscheme:modes:get-modes].}) (proc-doc/names drscheme:modes:mode? (any/c . -> . boolean?) (val) - @{Determines if \\var{val} is a mode.}) + @{Determines if @scheme[val] is a mode.}) (proc-doc/names drscheme:modes:get-modes @@ -603,8 +545,7 @@ all of the names in the tools library, for use defining keybindings @{Returns all of the modes currently added to DrScheme. See also - @scheme[flink drscheme:modes:add-mode] % - .}) + @scheme[drscheme:modes:add-mode].}) (proc-doc/names drscheme:modes:mode-name @@ -613,8 +554,7 @@ all of the names in the tools library, for use defining keybindings @{Extracts the name of the mode. See also - @scheme[flink drscheme:modes:add-mode] % - .}) + @scheme[drscheme:modes:add-mode].}) (proc-doc/names drscheme:modes:mode-surrogate @@ -623,8 +563,7 @@ all of the names in the tools library, for use defining keybindings @{Extracts the surrogate of the mode. See also - @scheme[flink drscheme:modes:add-mode] % - .}) + @scheme[drscheme:modes:add-mode].}) (proc-doc/names drscheme:modes:mode-repl-submit @@ -633,8 +572,7 @@ all of the names in the tools library, for use defining keybindings @{Extracts the repl submission predicate of the mode. See also - @scheme[flink drscheme:modes:add-mode] % - .}) + @scheme[drscheme:modes:add-mode].}) (proc-doc/names drscheme:modes:mode-matches-language @@ -643,8 +581,7 @@ all of the names in the tools library, for use defining keybindings @{Extracts the language matching predicate of the mode. See also - @scheme[flink drscheme:modes:add-mode] % - .}) + @scheme[drscheme:modes:add-mode].}) ; @@ -700,7 +637,7 @@ all of the names in the tools library, for use defining keybindings It is initialized to the repl that controls this evaluation in the user's thread. - It only returns \\scheme|#f| if the program not running + It only returns @scheme[#f] if the program not running in the context of a repl (eg, the test suite window).}) (proc-doc/names @@ -742,9 +679,9 @@ all of the names in the tools library, for use defining keybindings @{This class implements the tabs in drscheme. One is created for each tab in a frame (each frame always has at least one tab, even if the tab bar is not shown) - The argument, \\var{before}, controls if the mixin is applied before or + The argument, @scheme[before], controls if the mixin is applied before or after already installed mixins. - If unsupplied, this is the same as supplying \\scmc{\\#t}.}) + If unsupplied, this is the same as supplying @scheme[#t].}) (proc-doc/names drscheme:get/extend:extend-interactions-text @@ -755,9 +692,9 @@ all of the names in the tools library, for use defining keybindings @{This text is used in the bottom window of drscheme frames. - The argument, \\var{before}, controls if the mixin is applied before or + The argument, @scheme[before], controls if the mixin is applied before or after already installed mixins. - If unsupplied, this is the same as supplying \\scmc{\\#t}.}) + If unsupplied, this is the same as supplying @scheme[#t].}) (proc-doc/names drscheme:get/extend:get-interactions-text @@ -765,7 +702,7 @@ all of the names in the tools library, for use defining keybindings () @{Once this function is called, - @scheme[flink drscheme:get/extend:extend-interactions-text] + @scheme[drscheme:get/extend:extend-interactions-text] raises an error, disallowing any more extensions.}) (proc-doc/names @@ -777,9 +714,9 @@ all of the names in the tools library, for use defining keybindings @{This text is used in the top window of drscheme frames. - The argument, \\var{before}, controls if the mixin is applied before or + The argument, @scheme[before], controls if the mixin is applied before or after already installed mixins. - If unsupplied, this is the same as supplying \\scmc{\\#f}.}) + If unsupplied, this is the same as supplying @scheme[#f].}) (proc-doc/names drscheme:get/extend:get-definitions-text @@ -787,7 +724,7 @@ all of the names in the tools library, for use defining keybindings () @{Once this function is called, - @scheme[flink drscheme:get/extend:extend-definitions-text] + @scheme[drscheme:get/extend:extend-definitions-text] raises an error, disallowing any more extensions.}) (proc-doc/names @@ -799,9 +736,9 @@ all of the names in the tools library, for use defining keybindings @{This canvas is used in the bottom window of drscheme frames. - The argument, \\var{before}, controls if the mixin is applied before or + The argument, @scheme[before], controls if the mixin is applied before or after already installed mixins. - If unsupplied, this is the same as supplying \\scmc{\\#f}.}) + If unsupplied, this is the same as supplying @scheme[#f].}) (proc-doc/names drscheme:get/extend:get-interactions-canvas @@ -809,7 +746,7 @@ all of the names in the tools library, for use defining keybindings () @{Once this function is called, - @scheme[flink drscheme:get/extend:extend-interactions-canvas] + @scheme[drscheme:get/extend:extend-interactions-canvas] raises an error, disallowing any more extensions.}) (proc-doc/names @@ -821,9 +758,9 @@ all of the names in the tools library, for use defining keybindings @{This canvas is used in the top window of drscheme frames. - The argument, \\var{before}, controls if the mixin is applied before or + The argument, @scheme[before], controls if the mixin is applied before or after already installed mixins. - If unsupplied, this is the same as supplying \\scmc{\\#f}.}) + If unsupplied, this is the same as supplying @scheme[#f].}) (proc-doc/names drscheme:get/extend:get-definitions-canvas @@ -831,7 +768,7 @@ all of the names in the tools library, for use defining keybindings () @{Once this function is called, - @scheme[flink drscheme:get/extend:extend-definitions-canvas] + @scheme[drscheme:get/extend:extend-definitions-canvas] raises an error, disallowing any more extensions.}) (proc-doc/names @@ -843,9 +780,9 @@ all of the names in the tools library, for use defining keybindings @{This is the frame that implements the main drscheme window. - The argument, \\var{before}, controls if the mixin is applied before or + The argument, @scheme[before], controls if the mixin is applied before or after already installed mixins. - If unsupplied, this is the same as supplying \\scmc{\\#f}.}) + If unsupplied, this is the same as supplying @scheme[#f].}) (proc-doc/names drscheme:get/extend:get-unit-frame @@ -853,7 +790,7 @@ all of the names in the tools library, for use defining keybindings () @{Once this function is called, - @scheme[flink drscheme:get/extend:extend-unit-frame] + @scheme[drscheme:get/extend:extend-unit-frame] raises an error, disallowing any more extensions.}) @@ -900,13 +837,13 @@ all of the names in the tools library, for use defining keybindings (proc-doc/names drscheme:language-configuration:add-language - ((and/c (is-a?/c drscheme:language:language<%>) language-object) + ((and/c (is-a?/c drscheme:language:language<%>) drscheme:language:object/c) . -> . void?) (language) - @{\\phase{2} + @{@phase[2] - Adds \\var{language} to the languages offerend by DrScheme.}) + Adds @scheme[language] to the languages offerend by DrScheme.}) (proc-doc/names drscheme:language-configuration:get-settings-preferences-symbol @@ -914,14 +851,13 @@ all of the names in the tools library, for use defining keybindings () @{Returns the symbol that is used to store the user's language settings. Use as an argument to either - @scheme[flink preferences:get] + @scheme[preferences:get] or - @scheme[flink preferences:set] % - .}) + @scheme[preferences:set].}) (proc-doc/names drscheme:language-configuration:make-language-settings - ((or/c (is-a?/c drscheme:language:language<%>) language-object) + ((or/c (is-a?/c drscheme:language:language<%>) drscheme:language:object/c) any/c . -> . drscheme:language-configuration:language-settings?) @@ -934,11 +870,10 @@ all of the names in the tools library, for use defining keybindings value describing a parameterization of the language. It has two selectors, - @scheme[flink drscheme:language-configuration:language-settings-language] + @scheme[drscheme:language-configuration:language-settings-language] and - @scheme[flink drscheme:language-configuration:language-settings-settings] % - , and a predicate, - @scheme[flink drscheme:language-configuration:language-settings?]}) + @scheme[drscheme:language-configuration:language-settings-settings], and a predicate, + @scheme[drscheme:language-configuration:language-settings?]}) (proc-doc/names drscheme:language-configuration:language-settings-settings @@ -951,7 +886,7 @@ all of the names in the tools library, for use defining keybindings drscheme:language-configuration:language-settings-language (drscheme:language-configuration:language-settings? . -> . - (or/c (is-a?/c drscheme:language:language<%>) language-object)) + (or/c (is-a?/c drscheme:language:language<%>) drscheme:language:object/c)) (ls) @{Extracts the language field of a language-settings.}) @@ -974,30 +909,28 @@ all of the names in the tools library, for use defining keybindings (manuals? #f))) @{Opens the language configuration dialog. See also - @scheme[flink drscheme:language-configuration:fill-language-dialog] % - . + @scheme[drscheme:language-configuration:fill-language-dialog]. - The \\var{show-welcome?} argument determines if + The @scheme[show-welcome?] argument determines if if a ``Welcome to DrScheme'' message and some natural language buttons are shown. - The \\var{language-settings-to-show} argument + The @scheme[language-settings-to-show] argument must be some default language settings that the dialog is initialized to. If unsure of a default, the currently set language in the user's preferences can be obtained via: - \\begin{schemedisplay} + @schemeblock[ (preferences:get (drscheme:language-configuration:get-settings-preferences-symbol)) - \\end{schemedisplay} + ] - The \\var{parent} argument is used as the parent + The @scheme[parent] argument is used as the parent to the dialog. - The \\var{manuals?} argument is passed to - @scheme[flink drscheme:language-configuration:fill-language-dialog] % - . + The @scheme[manuals?] argument is passed to + @scheme[drscheme:language-configuration:fill-language-dialog]. - The result if \\scheme|#f| when the user cancells the dialog, and + The result if @scheme[#f] when the user cancells the dialog, and the selected language if they hit ok.}) (proc-doc/names @@ -1019,31 +952,31 @@ all of the names in the tools library, for use defining keybindings It is used to include language configuration controls in some larger context in another dialog. - The \\var{panel} argument is the main panel where the + The @scheme[panel] argument is the main panel where the language controls will be placed. - The function adds buttons to the \\var{button-panel} + The function adds buttons to the @scheme[button-panel] to revert a language to its default settings and to show the details of a language. - The \\var{language-setting} is the default + The @scheme[language-setting] is the default language to show in the dialog. - The \\var{re-center} argument is used when the \\gui{Show Details} - button is clicked. If that argument is a \\iscmintf{top-level-window}, - the \\gui{Show Details} callback will recenter the window each time + The @scheme[re-center] argument is used when the @onscreen{Show Details} + button is clicked. If that argument is a @scheme[top-level-window<%>], + the @onscreen{Show Details} callback will recenter the window each time it is clicked. Otherwise, the argument is not used. - If \\var{manuals?} is \\scheme{#f} the usual language dialog (as seen + If @scheme[manuals?] is @scheme[#f] the usual language dialog (as seen in the start up drscheme window and from the Choose Language dialog created when drscheme is started up) is shown. If it isn't, the dialog does not have the details and on the right-hand side shows the manual ordering for the chosen language. This is used in Help Desk. - \\var{ok-handler} is a function that is in charge of interfacing the OK - button. It should accept a symbol message: \\scheme{'enable} and - \\scheme{'disable} to toggle the button, and \\scheme{'execute} to run + @scheme[ok-handler] is a function that is in charge of interfacing the OK + button. It should accept a symbol message: @scheme['enable] and + @scheme['disable] to toggle the button, and @scheme['execute] to run the desired operation. (The language selection dialog also uses an - internal \\scheme{'enable-sync} message.)}) + internal @scheme['enable-sync] message.)}) (proc-doc drscheme:language:register-capability @@ -1056,49 +989,56 @@ all of the names in the tools library, for use defining keybindings and a contract on the values the capability might have. By default, these capabilities are registered as DrScheme starts up: - \\begin{itemize} - \\item \\scheme|(drscheme:language:register-capability 'drscheme:check-syntax-button (flat-contract boolean?) #t)| + @itemize{ + @item{ @scheme[(drscheme:language:register-capability 'drscheme:check-syntax-button (flat-contract boolean?) #t)] --- controls the visiblity of the check syntax button - \\item \\scheme|(drscheme:language:register-capability 'drscheme:language-menu-title (flat-contract string?) (string-constant scheme-menu-name))| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:language-menu-title (flat-contract string?) (string-constant scheme-menu-name))] --- controls the name of the menu just to the right of the language menu (defaultly named ``Scheme'') - \\item \\scheme|(drscheme:language:register-capability 'drscheme:define-popup (or/c (cons/c string? string?) false/c) (cons \"(define\" \"(define ...)\"))| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:define-popup (or/c (cons/c string? string?) false/c) (cons "(define" "(define ...)"))] --- specifies the prefix that the define popup should look for and what label it should have, - or \\scheme|#f| if it should not appear at all. - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-fraction (flat-contract boolean?) #t)| + or @scheme[#f] if it should not appear at all. + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-fraction (flat-contract boolean?) #t)] --- determines if the insert fraction menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-lambda (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-lambda (flat-contract boolean?) #t)] --- determines if the insert lambda menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-large-letters (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-large-letters (flat-contract boolean?) #t)] --- determines if the insert large letters menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-image (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-image (flat-contract boolean?) #t)] --- determines if the insert image menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-comment-box (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-comment-box (flat-contract boolean?) #t)] --- determines if the insert comment box menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-gui-tool (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-gui-tool (flat-contract boolean?) #t)] --- determines if the insert gui menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:slideshow-menu-item (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:slideshow-menu-item (flat-contract boolean?) #t)] --- determines if the insert pict box menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:insert-text-box (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:insert-text-box (flat-contract boolean?) #t)] --- determines if the insert text box menu item in the special menu is visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:special:xml-menus (flat-contract boolean?) #t)| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:special:xml-menus (flat-contract boolean?) #t)] --- determines if the insert scheme box, insert scheme splice box, and the insert xml box menu item ins the special menu are visible - \\item \\scheme|(drscheme:language:register-capability 'drscheme:autocomplete-words (listof string?) '()| + }@item{ @scheme[(drscheme:language:register-capability 'drscheme:autocomplete-words (listof string?) '())] --- determines the list of words that are used when completing words in this language - \\end{itemize}}) + }}}) (proc-doc/names drscheme:language:capability-registered? (-> symbol? boolean?) (s) @{Indicates if - @scheme[flink drscheme:language:register-capability] - has been called with \\var{s}.}) + @scheme[drscheme:language:register-capability] + has been called with @scheme[s].}) (proc-doc drscheme:language:get-capability-default (->d ([s (and/c symbol? drscheme:language:capability-registered?)]) () [res (drscheme:language:get-capability-contract s)]) @{Returns the default for a particular capability.}) + (proc-doc/names + drscheme:language:get-capability-contract + (-> (and/c symbol? drscheme:language:capability-registered?) + contract?) + (s) + @{Returns the contract for a given capability, which was specified + when @scheme[drscheme:langauge:register-capability] was called.}) ; @@ -1119,6 +1059,11 @@ all of the names in the tools library, for use defining keybindings ; ;;;; ;;;; + (thing-doc + drscheme:language:object/c + contract? + @{@(oc schemeblock here)}) + (proc-doc/names drscheme:language:add-snip-value (->* ((-> any/c boolean?) @@ -1129,9 +1074,9 @@ all of the names in the tools library, for use defining keybindings ((setup-thunk void))) @{Registers a handler to convert values into snips as they are printed in the REPL. - The \\var{test-snip} argument is called to determine if this handler can convert the value - and the \\var{convert-value} argument is called to build a snip. - The (optional) \\var{setup-thunk} is called just after the user's namespace and other + The @scheme[test-snip] argument is called to determine if this handler can convert the value + and the @scheme[convert-value] argument is called to build a snip. + The (optional) @scheme[setup-thunk] is called just after the user's namespace and other setings are built, but before any of the user's code is evaluated. All three functions are called on the user's thread and with the user's settings.}) @@ -1143,41 +1088,38 @@ all of the names in the tools library, for use defining keybindings void?) (interface default-implementation) - @{\\phase{1} + @{@phase[1] Each language added passed to - @scheme[flink drscheme:language-configuration:add-language] - must implement \\var{interface}. + @scheme[drscheme:language-configuration:add-language] + must implement @scheme[interface]. - The \\var{default-implementation} is a mixin + The @scheme[default-implementation] is a mixin that provides a default implementation of - \\var{interface}. Languages that are unaware of - the specifics of \\var{extension} use - \\var{default-implementation} via - @scheme[flink drscheme:language:get-default-mixin] % - .}) + @scheme[interface]. Languages that are unaware of + the specifics of @scheme[extension] use + @scheme[default-implementation] via + @scheme[drscheme:language:get-default-mixin].}) (proc-doc drscheme:language:get-default-mixin (-> (make-mixin-contract drscheme:language:language<%>)) - @{\\phase{2} + @{@phase[2] The result of this function is the composite of all of the - \\var{default-implementation} arguments passed + @scheme[default-implementation] arguments passed to - @scheme[flink drscheme:language:extend-language-interface] % - .}) + @scheme[drscheme:language:extend-language-interface].}) (proc-doc/names drscheme:language:get-language-extensions (-> (listof interface?)) () - @{\\phase{2} + @{@phase[2] Returns a list of the interfaces passed to - @scheme[flink drscheme:language:extend-language-interface] % - .}) + @scheme[drscheme:language:extend-language-interface].}) (proc-doc/names drscheme:language:put-executable @@ -1189,21 +1131,21 @@ all of the names in the tools library, for use defining keybindings . -> . (or/c false/c path?)) (parent program-filename mode mred? title) @{Calls the MrEd primitive - @scheme[flink put-file] + @scheme[put-file] with arguments appropriate for creating an executable - from the file \\var{program-filename}. + from the file @scheme[program-filename]. - The arguments \\var{mred?} and \\var{mode} indicates + The arguments @scheme[mred?] and @scheme[mode] indicates what type of executable this should be (and the dialog may be slightly different on some platforms, depending - on these arguments). For historical reasons, \\scmc{\\#f} - is allowed for \\var{mode} as an alias for \\Symbol{launcher}, and - \\scmc{\\#t} is allowed for \\var{mode} as an alias for \\Symbol{stand-alone}. + on these arguments). For historical reasons, @scheme[#f] + is allowed for @scheme[mode] as an alias for @scheme['launcher], and + @scheme[#t] is allowed for @scheme[mode] as an alias for @scheme['stand-alone]. - The \\var{title} argument is used as the title to the primitive - @scheme[flink put-file] + The @scheme[title] argument is used as the title to the primitive + @scheme[put-file] or - @scheme[flink get-directory] + @scheme[get-directory] primitive.}) (proc-doc/names @@ -1219,22 +1161,22 @@ all of the names in the tools library, for use defining keybindings string?))) (parent program-name show-type show-base) @{Opens a dialog to prompt the user about their choice of executable. - If \\var{show-type} is \\scmc{\\#t}, the user is prompted about + If @scheme[show-type] is @scheme[#t], the user is prompted about a choice of executable: stand-alone, launcher, or distribution; otherwise, the symbol determines the type. - If \\var{show-base} - is \\scmc{\\#t}, the user is prompted about a choice of base + If @scheme[show-base] + is @scheme[#t], the user is prompted about a choice of base binary: mzscheme or mred; otherwise the symbol determines the base. - The \\var{program-name} argument is used to construct the default + The @scheme[program-name] argument is used to construct the default executable name in a platform-specific manner. - The \\var{parent} argument is used for the parent of the dialog. + The @scheme[parent] argument is used for the parent of the dialog. - The result of this function is \\scmc{\\#f} if the user cancel's + The result of this function is @scheme[#f] if the user cancel's the dialog and a list of three items indicating what options - they chose. If either \\var{show-type} or \\var{show-base} - was not \\scmc{\\#t}, the corresponding result will be \\scmc{'no-show}, + they chose. If either @scheme[show-type] or @scheme[show-base] + was not @scheme[#t], the corresponding result will be @scheme['no-show], otherwise it will indicate the user's choice.}) (proc-doc/names @@ -1252,29 +1194,29 @@ all of the names in the tools library, for use defining keybindings use-copy?) @{This procedure creates a stand-alone executable in the file - \\var{executable-filename} that runs the program - \\var{program-filename}. + @scheme[executable-filename] that runs the program + @scheme[program-filename]. The arguments - \\var{module-language-spec} and - \\var{transformer-module-language-spec} specify the + @scheme[module-language-spec] and + @scheme[transformer-module-language-spec] specify the settings of the initial namespace, both the transformer portion and the regular portion. - The \\var{init-code} argument is an s-expression representing + The @scheme[init-code] argument is an s-expression representing the code for a module. This module is expected to provide - the identifer \\rawscm{init-code}, bound to a procedure of no - arguments. That module is required and the \\var{init-code} + the identifer @scheme[init-code], bound to a procedure of no + arguments. That module is required and the @scheme[init-code] procedure is executed to initialize language-specific - settings before the code in \\var{program-filename} runs. + settings before the code in @scheme[program-filename] runs. - The \\var{gui?} argument indicates if a MrEd or MzScheme + The @scheme[gui?] argument indicates if a MrEd or MzScheme stand-alone executable is created. - The \\var{use-copy?} argument indicates if the initial + The @scheme[use-copy?] argument indicates if the initial namespace should be populated with - \\rawscm{namespace-require/copy} or - \\rawscm{namespace-require}. }) + @scheme[namespace-require/copy] or + @scheme[namespace-require]. }) (proc-doc/names drscheme:language:create-module-based-distribution @@ -1291,8 +1233,7 @@ all of the names in the tools library, for use defining keybindings use-copy?) @{Like - @scheme[flink drscheme:language:create-module-based-stand-alone-executable] % - , but packages the stand-alone executable into a distribution.}) + @scheme[drscheme:language:create-module-based-stand-alone-executable], but packages the stand-alone executable into a distribution.}) (proc-doc/names drscheme:language:create-distribution-for-executable @@ -1305,14 +1246,14 @@ all of the names in the tools library, for use defining keybindings gui? make-executable) - @{Creates a distribution where the given \\var{make-executable} procedure + @{Creates a distribution where the given @scheme[make-executable] procedure creates the stand-alone executable to be distributed. - The \\var{make-executable} procedure is given the name of the - executable to create. The \\var{gui?} argument is needed in case the - executable's name (which \\rawscm{drscheme:language:create-distribution-for-executable} + The @scheme[make-executable] procedure is given the name of the + executable to create. The @scheme[gui?] argument is needed in case the + executable's name (which @scheme[drscheme:language:create-distribution-for-executable] must generate) depends on the type of executable. During the distribution-making process, a progress dialog is shown to the user, and the user can click an - \\OnScreen{Abort} button that sends a break to the current thread.}) + @onscreen{Abort} button that sends a break to the current thread.}) (proc-doc/names drscheme:language:create-module-based-launcher @@ -1328,8 +1269,7 @@ all of the names in the tools library, for use defining keybindings use-copy?) @{This procedure is identical to - @scheme[flink drscheme:language:create-module-based-stand-alone-executable] % - , except that it creates a launcher instead of a + @scheme[drscheme:language:create-module-based-stand-alone-executable], except that it creates a launcher instead of a stand-alone executable.}) (proc-doc/names @@ -1337,7 +1277,7 @@ all of the names in the tools library, for use defining keybindings (drscheme:language:text/pos? . -> . (is-a?/c text%)) (text/pos) - @{Selects the \\iscmclass{text} from a text/pos.}) + @{Selects the @scheme[text%] from a text/pos.}) (proc-doc/names drscheme:language:text/pos-start @@ -1358,7 +1298,7 @@ all of the names in the tools library, for use defining keybindings (any/c . -> . boolean?) (val) - @{Returns \\scmc{\\#t} if \\var{val} is a text/pos, and \\scmc{\\#f} + @{Returns @scheme[#t] if @scheme[val] is a text/pos, and @scheme[#f] otherwise.}) (proc-doc/names @@ -1430,7 +1370,7 @@ all of the names in the tools library, for use defining keybindings (any/c . -> . boolean?) (val) - @{Determines if \\var{val} is a simple-settings.}) + @{Determines if @scheme[val] is a simple-settings.}) (proc-doc/names drscheme:language:make-simple-settings @@ -1455,4 +1395,4 @@ all of the names in the tools library, for use defining keybindings (drscheme:language:simple-settings? . -> . vector?) (simple-settings) - @{Constructs a vector whose elements are the fields of \\var{simple-settings}.})) \ No newline at end of file + @{Constructs a vector whose elements are the fields of @scheme[simple-settings].})) \ No newline at end of file diff --git a/collects/scribble/srcdoc.ss b/collects/scribble/srcdoc.ss index e7df61341e..8e51d2bee8 100644 --- a/collects/scribble/srcdoc.ss +++ b/collects/scribble/srcdoc.ss @@ -6,6 +6,7 @@ (provide require/doc provide/doc + thing-doc parameter-doc proc-doc proc-doc/names) @@ -205,3 +206,19 @@ #'(defparam id arg-id contract . desc) #'(scribble/manual) #'id))]))) + +(define-provide/doc-transformer thing-doc + (lambda (stx) + (syntax-case stx () + [(_ id contract desc) + (begin + (unless (identifier? #'id) + (raise-syntax-error 'parameter/doc + "expected an identifier" + stx + #'id)) + (values + #'[id contract] + #'(defthing id contract . desc) + #'(scribble/manual) + #'id))]))) diff --git a/collects/scribblings/tools/tools.scrbl b/collects/scribblings/tools/tools.scrbl index c3ab652b5f..1d4ca2e013 100644 --- a/collects/scribblings/tools/tools.scrbl +++ b/collects/scribblings/tools/tools.scrbl @@ -43,7 +43,7 @@ Christian Queinnec, PLT at large, and many others for their feedback and help. -@section{Implementing DrScheme Tools} +@section[#:tag "implementing-tools"]{Implementing DrScheme Tools} Tools are designed for major extensions in DrScheme's functionality. To extend the appearance