(lispref.info)Interactive Codes

Next: Interactive Examples Prev: Using Interactive Up: Defining Commands

Code Characters for `interactive'

   The code character descriptions below contain a number of key words,
defined here as follows:

     Provide completion.  TAB, SPC, and RET perform name completion
     because the argument is read using `completing-read' (*note
     Completion::.).  `?' displays a list of possible completions.

     Require the name of an existing object.  An invalid name is not
     accepted; the commands to exit the minibuffer do not exit if the
     current input is not valid.

     A default value of some sort is used if the user enters no text in
     the minibuffer.  The default depends on the code character.

No I/O
     This code letter computes an argument without reading any input.
     Therefore, it does not use a prompt string, and any prompt string
     you supply is ignored.

     A prompt immediately follows the code character.  The prompt ends
     either with the end of the string or with a newline.

     This code character is meaningful only at the beginning of the
     interactive string, and it does not look for a prompt or a newline.
     It is a single, isolated character.

   Here are the code character descriptions for use with `interactive':

     Signal an error if the current buffer is read-only.  Special.

     Select the window mentioned in the first mouse event in the key
     sequence that invoked this command.  Special.

     Do not cause the region to be deactivated when this command
     completes.  Special.

     A function name (i.e., a symbol which is `fboundp').  Existing,
     Completion, Prompt.

     The name of an existing buffer.  By default, uses the name of the
     current buffer (Note: Buffers.).  Existing, Completion, Default,

     A buffer name.  The buffer need not exist.  By default, uses the
     name of a recently used buffer other than the current buffer.
     Completion, Prompt.

     A character.  The cursor does not move into the echo area.  Prompt.

     A command name (i.e., a symbol satisfying `commandp').  Existing,
     Completion, Prompt.

     The position of point as a number (Note: Point.).  No I/O.

     A directory name.  The default is the current default directory of
     the current buffer, `default-directory' (Note: System
     Environment.).  Existing, Completion, Default, Prompt.

     The last mouse event in the key sequence that invoked the command.
     No I/O.

     A file name of an existing file (Note: File Names.).  The default
     directory is `default-directory'.  Existing, Completion, Default,

     A file name.  The file need not exist.  Completion, Default,

     A key sequence (Note: Keymap Terminology.).  This keeps reading
     events until a command (or undefined command) is found in the
     current key maps.  The key sequence argument is represented as a
     vector of events.  The cursor does not move into the echo area.

     This kind of input is used by commands such as `describe-key' and

     The position of the mark as a number.  No I/O.

     A number read with the minibuffer.  If the input is not a number,
     the user is asked to try again.  The prefix argument, if any, is
     not used.  Prompt.

     The raw prefix argument.  If the prefix argument is `nil', then a
     number is read as with `n'.  Requires a number.  Prompt.

     The numeric prefix argument.  (Note that this `p' is lower case.)
     No I/O.

     The raw prefix argument.  (Note that this `P' is upper case.)
     Note: Prefix Command Arguments.  No I/O.

     Point and the mark, as two numeric arguments, smallest first.
     This is the only code letter that specifies two successive
     arguments rather than one.  No I/O.

     Arbitrary text, read in the minibuffer and returned as a string
     (Note: Text from Minibuffer.).  Terminate the input with either
     LFD or RET.  (`C-q' may be used to include either of these
     characters in the input.)  Prompt.

     An interned symbol whose name is read in the minibuffer.  Any
     whitespace character terminates the input.  (Use `C-q' to include
     whitespace in the string.)  Other characters that normally
     terminate a symbol (e.g., parentheses and brackets) do not do so
     here.  Prompt.

     A variable declared to be a user option (i.e., satisfying the
     predicate `user-variable-p').  Note: High-Level Completion.
     Existing, Completion, Prompt.

     A Lisp object specified in printed representation, terminated with
     a LFD or RET.  The object is not evaluated.  Note: Object from
     Minibuffer.  Prompt.

     A Lisp form is read as with `x', but then evaluated so that its
     value becomes the argument for the command.  Prompt.

automatically generated by info2www