MrEd starts up with the following sequence of actions:
The default collections path uses the PLTHOME envionment variable, or finds a collects directory relative to the MrEd executable's directory, or (as a last resort) uses a platform-specific default. More precisely, the default collections path is the first of the following paths that exists:
The algorithm for setting the collection search path is expressed by the following MzScheme expression, where PROGRAM is bound to the name of the MrEd executable:
(current-library-collection-paths (path-list-string->path-list (or (getenv "PLTCOLLECTS") "") (or (ormap (lambda (p) (and p (directory-exists? p) (list p))) (list (let ((v (getenv "PLTHOME"))) (and v (build-path v "collects"))) (find-executable-path PROGRAM "collects") (case (system-type) [(unix) "/usr/local/lib/plt/collects"] [(windows) "C:\\plt\\collects"] [(macos) #f]))) null)))
The --pre thread's parameterization is the initial parameterization, from which all other parameterizations are derived. Thus, changing a parameter value in this parameterization effectively overrides the built-in default value for MrEd.
See for information about command-line arguments under MacOS.
All X Windows flags must follow --pre's argument if --pre is used, and X Windows flags and arguments must precede all other flags and arguments.
By default, the system collection name is system. A different collection for the system can be specified with the -s flag followed by a collection name argument. The -s flag must follow the --pre and X Windows flags and arguments if they are present, and it must precede all other flags and arguments.
The system is loaded by the initial eventspace's main thread into a namespace that contains all of the built-in MzScheme syntax and procedures, the wx^ signature, the wx@ signed unit (see Core Toolbox), and the global variables defined by using invoke-open-unit/sig on the wx@ unit with the prefix wx:. The same namespace was used for evaluating the --pre expression (before the wx: definitions were added); if the --pre expression modifies the namespace, the modifications will be intact when the system is loaded.
After mred:initialize returns, MrEd runs until the default exit handler is invoked.
The system collection's mred:initialize performs the following sequence of actions:
The splash screen is specified in the info.ss file, if you use the -A flag. See the info.ss section. You can specify the splash screen on the command line with the -p and -b flags. The latter technique only works if you are using either the -a or the -u option.
The splash screen will always show a progress bar, indicating how many files have been loaded. If you evaluate this expression:
(wx:write-resource "mred" "splashMessages" 1 (wx:find-path 'setup-file))it will also show the file names as they are being loaded. This is useful for developers of applications, but not very useful for clients.
The first time the splash screen is opened, it guesses the number of files loaded and the depth of the recursive loads (for unitized applications using the -A flag, the info file specifies those initial guesses). After the application starts up, MrEd records the those numbers, for future uses of the splash screen. For unitized applications, the numbers are keyed on the applications name, and for non-unitized applications, only one set of numbers are saved, so two different non-unitized application's numbers will conflict with each other.
The user setup is not always loaded last. In general it is loaded when all of the variables that begin with mred: are defined. So, if you are using the -u flag, the user setup is loaded before any of the files on the command line are loaded and if you are not using the -u flag, the user setup is loaded after all of the command line arguments have been processed.
If the system is not found, or if there is an uncaught error while the system is loaded, then the load is aborted and a plain text editing window is opened.