Macro
editor
defcommand name lambda-list command-doc function-doc &body forms => command-name
The name of the new editor command. See Description for more details.
The lambda list of the new command, which must have at least one argument.
A string which gives a long-form command description.
A string which gives a short-form function description.
The Lisp code for the command.
The symbol name of the new command.
Extended Command. . Any Editor command has a Lisp function associated with it. The macro takes the specification of the command as supplied, and creates a new Lisp function from it. defcommand. To make use of an existing command, the command name should be hyphenated with acommand suffix added. For example, the editor commandForward Character is referred to byforward-character-command. The syntax of a call to an existing command is the same as a call to a standard Lisp function. The first argument of all command definitions is the prefix argument, and this must therefore be included in any calls made to commands fromdefcommand, even when prefix arguments are ignored by the command. Some commands have additional optional arguments and details of these are provided in the command descriptions throughout this manual. defcommand derives itself, is required, then this can be supplied explicitly, by passing a list as name. The first element of the list is the string used as the name of the command, while the last element is the symbol used to name the Lisp function. Move Five, which moves the cursor forward in an editor buffer by five characters.
(defcommand "Move Five" (p)
"Moves the current point forward five characters.
Any prefix argument is ignored."
"Moves five characters forward."
(forward-character-command 5))