diff options
author | Glenn Morris <rgm@gnu.org> | 2014-10-04 00:05:21 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2014-10-04 00:05:21 -0700 |
commit | 10501882f7c23525c14f3f4712ce34f7fe335864 (patch) | |
tree | f8b8b8a7d2abbfeaf4a48ccd0082e3c80dd5a15e /doc/lispref/commands.texi | |
parent | 03c4553666d2e99d4e6f51f2195c0136d317f0c9 (diff) | |
parent | 9352c1465fc4c32e04e763b4bf70e24292f06eed (diff) | |
download | emacs-10501882f7c23525c14f3f4712ce34f7fe335864.tar.gz |
Merge from emacs-24; up to 2014-07-20T16:14:58Z!dmantipov@yandex.ru
Diffstat (limited to 'doc/lispref/commands.texi')
-rw-r--r-- | doc/lispref/commands.texi | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 58e903918bf..e5db4d87539 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -589,31 +589,26 @@ Put them into three windows, selecting the last one." @cindex alternatives, defining The macro @code{define-alternatives} can be used to define -@dfn{generic commands}. Generic commands are interactive functions -whose implementation can be selected among several alternatives, as a -matter of user preference. +@dfn{generic commands}. These are interactive functions whose +implementation can be selected from several alternatives, as a matter +of user preference. @defmac define-alternatives command &rest customizations -Define the new command `COMMAND'. +Define the new command @var{command}, a symbol. -The argument `COMMAND' should be a symbol. +When a user runs @kbd{M-x @var{command} @key{RET}} for the first time, +Emacs prompts for which real form of the command to use, and records +the selection by way of a custom variable. Using a prefix argument +repeats this process of choosing an alternative. -When a user runs @kbd{M-x COMMAND @key{RET}} for the first time, Emacs -will prompt for which alternative to use and record the selected -command as a custom variable. +The variable @code{@var{command}-alternatives} should contain an alist +with alternative implementations of @var{command}. +Until this variable is set, @code{define-alternatives} has no effect. -Running @kbd{C-u M-x COMMAND @key{RET}} prompts again for an -alternative and overwrites the previous choice. - -The variable @code{COMMAND-alternatives} contains an alist -(@pxref{Association Lists}) with alternative implementations of -`COMMAND'. @code{define-alternatives} does not have any effect until -this variable is set. - -If @var{customizations} is non-@var{nil}, it should be composed of -alternating @code{defcustom} keywords and values to add to the -declaration of @code{COMMAND-alternatives} (typically :group and -:version). +If @var{customizations} is non-@code{nil}, it should consist of +alternating @code{defcustom} keywords (typically @code{:group} and +@code{:version}) and values to add to the declaration of +@code{@var{command}-alternatives}. @end defmac @node Interactive Call |