Next: , Previous: , Up: Commands   [Contents][Index]


17.3 Interactive Calling Specification

The spec argument to interactive or define-command defines the argument values applied to the command when it is called interactively. It may be one of:

nil or undefined

No arguments are given to the command.

A string

It consists of zero or more lines (each separated by a newline character). Each line defines how to compute one argument value. The first one or two characters of each line is a prefix defining exactly how to compute the argument, the rest of the line is an optional argument which some prefixes may use. See below for a list of prefixes. A null line produces an argument value of nil.

Anything else

The form is evaluated and expected to return a list of arguments to apply to the command.

The currently available prefixes are,

e

The event which caused this command to be invoked.

E

The event which caused this command, cooked into a string.

p

The prefix argument as a number, this will be 1 if no prefix argument has been entered.

P

The raw prefix argument.

t

The symbol t.

%f

The window which currently has the input focus, or nil if no window is focused.

%w

The result of calling the current-event-window function.

%W

The result of calling the current-event-window function, or if this returns nil or root, the currently focused window.