Next: , Previous: Command Overview, Up: Command Loop

21.2 Defining Commands

The special form interactive turns a Lisp function into a command. The interactive form must be located at top-level in the function body (usually as the first form in the body), or in the interactive-form property of the function symbol. When the interactive form is located in the function body, it does nothing when actually executed. Its presence serves as a flag, which tells the Emacs command loop that the function can be called interactively. The argument of the interactive form controls the reading of arguments for an interactive call.