A string containing the name of the mode being defined.
Name of function which sets up a buffer in this mode.
A quoted list of key-binding directions.
, the mode cannot be re-defined. The default value is
A quoted list of Editor variables and values.
A quoted list of synonyms for name.
Called upon exit from a buffer in this mode.
, the mode is defined as major, otherwise minor. The default value is
is essentially for the purposes of mode specification--not all of the essential definitions required to establish a new Editor mode are made in a
call. In the example, below, other required calls are shown.
key-bindings can be defined by supplying a quoted list of bindings, where a binding is a list containing as a first element the (string) name of the Editor command being bound, and as the second, the key binding description (see Advanced Features, for example key-bindings).
The state of Editor variables can be changed in the definition of a mode. These are supplied as a quoted list vars of dotted pairs, where the first element of the pair is the (symbol) name of the editor variable to be changed, and the second is the new value.
Both setup-function and cleanup-function are called with the mode and the buffer locked. They can modify the buffer itself, but they must not wait for anything that happens on another process, and they must not modify the mode (for example by setting a variable in the mode), and must not try to update the display.
(editor:defmode "Foo" :setup-function 'setup-foo-mode)