drscheme:eval:build-user-eventspace/custodian in DrScheme Tools Functions
(drscheme:eval:build-user-eventspace/custodian -> (values eventspace? custodian?)
language-settings init kill-termination)
language-settings : drscheme:language-configuration:language-settings?
init : (-> void?)
kill-termination : (-> void?)
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 custodian-shutdown-all) after the expansion is finished.
It initializes the user's eventspace's main thread with several parameters:
current-custodian is set to a new custodian.
In addition, it calls
drscheme:eval:set-basic-parameters.
The language-settings argument is the current
language and its settings. See
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
get-next-settings method of
drscheme:unit:definitions-text<%>. Also, the most recently chosen language in
the language dialog is saved via the framework's
preferences. Apply
preferences:get to
drscheme:language-configuration:get-settings-preferences-symbol for that language-settings.
The 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
current-directory and
current-load-relative-directory
parameters are not set, so if there are appropriate directories,
the init argument is a good place to set them.
The 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 (i. e., not the thread
created to do the expansion, nor the thread that
drscheme:eval:build-user-eventspace/custodian was called from.)