2.4.4.2. - Built-In Macro Names
The following macro names are built-in to spec. They are run at the specified times only if they have been given a definition.
begin_mac- If a macro by this name exists, it will be run
after reading the hardware configuration file and all the start-up
command files, but before reading commands from the keyboard.
end_mac- If a macro by this name exists, it will be run
when spec exits from either a
^Dor aquitcommand. config_mac- If a macro by this name exists, it will be run after reading the
configuration file at start up and after the
reconfigcommand is executed. prompt_mac- If a macro by this name exists, it will always be run just before
spec issues the main, level-zero prompt.
If an error occurs while running
prompt_mac, it will be automatically undefined. cleanup, cleanup1-
If either or both exists, they will be run
whenever an error is encountered, the
exitcommand is encountered, or a user types^C. Thecleanupmacro is run first. After running the clean-up macros, spec gives the standard prompt and waits for the next command from the keyboard. cleanup_once- A clean-up macro that is
always deleted before a new spec
main prompt is issued.
If defined, its definition will be pushed on to the input stream
whenever an error is encountered, the
exitcommand is encountered, or a user types^C. cleanup_always- Like
cleanup_once, but its definition is not removed except by an explicitundefcommand.
Thecleanupandcleanup1macros are no longer used in the standard macros. The more recentcleanup_onceandcleanup_alwaysmacros are preferred.
Macro definitions for these built-in macros should be maintained usingcdef()so that independent macro packages can make use of the macros without interference.
