drscheme:eval:build-user-eventspace/custodian in DrScheme Tools Functions
(drscheme:eval:build-user-eventspace/custodian-> (values eventspace? custodian?)language-settingsinitkill-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-custodianis set to a new custodian.In addition, it calls
drscheme:eval:set-basic-parameters.
The
language-settingsargument is the current language and its settings. Seedrscheme:language-configuration:make-language-settingsfor details on that structure.If the program is associated with a DrScheme frame, get the frame's language settings from the
get-next-settingsmethod ofdrscheme:unit:definitions-text<%>. Also, the most recently chosen language in the language dialog is saved via the framework's preferences. Applypreferences:gettodrscheme:language-configuration:get-settings-preferences-symbolfor thatlanguage-settings.The
initargument 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, theinitargument is a good place to set them.The
kill-terminationargument 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 thatdrscheme:eval:build-user-eventspace/custodianwas called from.)