on-execute in drscheme:language:language<%>
The on-execute method is called on DrScheme's
eventspace's main thread before any evaluation happens
during execution. Use this method to initialize MzScheme's
parameters for the user. When
this function is called, the user's thread has already been
created, as has its custodian. These parameters have been
changed from the defaults in MzScheme:
current-custodianis set to a new custodian.current-namespacehas been set to a newly created empty namespace.This namespace has the following modules copied (withnamespace-attach-module) from DrScheme's original namespace:'mzscheme'(lib "mred.ss" "mred")
read-curly-brace-as-parenis#t,read-square-bracket-as-parenis#t,The
port-write-handlerandport-display-handlerhave been set to procedures that callpretty-printandpretty-displayinstead ofwriteanddisplay. Whenpretty-printandpretty-displayare called by these parameters, thepretty-print-columnsparameter is set to'infinity, so the output looks just likewriteanddisplay. This is done so that special scheme values can be displayed as snips.The current-print-covert-hook is to a procedure so that
snip%s are just returned directly to be inserted into the interactionstext%object.The output and input ports are set to point to the interactions window with these parameters:
current-input-port,current-output-port, andcurrent-error-port.The
event-dispatch-handleris set so that DrScheme can perform some initial setup and close down around the user's code.The
current-directoryandcurrent-load-relative-directoryare set to the directory where the definitions file is saved, or if it isn't saved, to the initial directory where DrScheme started up.The snip-class-list, returned by
get-the-snip-class-listis initialized with all of the snipclasses in DrScheme's eventspace's snip-class-list.The error-print-source-location parameter is set to
#fand the error-display-handler is set to a handler that creates an error message from the exception record, with font and color information and inserts that error message into the definitions window.
The run-in-user-thread arguments accepts thunks and
runs them on the user's eventspace's main thread. These
thunks must not raise an exceptions (or drscheme itself will
get stuck). In addition, the output ports are not yet
functioning, so print outs should be directed to the
original drscheme output port, if necessary.
(-> anysenda-drscheme:language:languageon-executesettingsrun-in-user-thread)
settings: settings
run-in-user-thread: ((-> any) -> any)