aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-13 17:19:36 +0000
committerRichard M. Stallman2003-08-13 17:19:36 +0000
commit041b0e7bd7df98929d9bf3e035bc3a1da0916a30 (patch)
treeba1c0e3ca7bdf7bc6b6c63ce9c2f52c604fc4013
parent1002b9b5d9bf444804b1e1de5b28cbf9889cb18a (diff)
downloademacs-041b0e7bd7df98929d9bf3e035bc3a1da0916a30.tar.gz
emacs-041b0e7bd7df98929d9bf3e035bc3a1da0916a30.zip
(Interactive Call): commandp has new arg.
(Command Loop Info): Add this-original-command.
-rw-r--r--lispref/commands.texi20
1 files changed, 15 insertions, 5 deletions
diff --git a/lispref/commands.texi b/lispref/commands.texi
index f749ec21d5c..d032f7caf10 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -503,7 +503,7 @@ command is a function, @code{command-execute} calls
503@code{call-interactively}, which reads the arguments and calls the 503@code{call-interactively}, which reads the arguments and calls the
504command. You can also call these functions yourself. 504command. You can also call these functions yourself.
505 505
506@defun commandp object 506@defun commandp object &optional for-call-interactively
507Returns @code{t} if @var{object} is suitable for calling interactively; 507Returns @code{t} if @var{object} is suitable for calling interactively;
508that is, if @var{object} is a command. Otherwise, returns @code{nil}. 508that is, if @var{object} is a command. Otherwise, returns @code{nil}.
509 509
@@ -514,11 +514,13 @@ expressions, autoload objects that are declared as interactive
514(non-@code{nil} fourth argument to @code{autoload}), and some of the 514(non-@code{nil} fourth argument to @code{autoload}), and some of the
515primitive functions. 515primitive functions.
516 516
517A symbol satisfies @code{commandp} if its function definition satisfies 517A symbol satisfies @code{commandp} if its function definition
518@code{commandp}. 518satisfies @code{commandp}. Keys and keymaps are not commands.
519Rather, they are used to look up commands (@pxref{Keymaps}).
519 520
520Keys and keymaps are not commands. Rather, they are used to look up 521If @var{for-call-interactively} is non-@code{nil}, then
521commands (@pxref{Keymaps}). 522@code{commandp} returns @code{t} only for objects that
523@code{call-interactively} could call---thus, not for keyboard macros.
522 524
523See @code{documentation} in @ref{Accessing Documentation}, for a 525See @code{documentation} in @ref{Accessing Documentation}, for a
524realistic example of using @code{commandp}. 526realistic example of using @code{commandp}.
@@ -731,6 +733,14 @@ We do not bind @code{this-command} with @code{let} because that would
731restore the old value in case of error---a feature of @code{let} which 733restore the old value in case of error---a feature of @code{let} which
732in this case does precisely what we want to avoid. 734in this case does precisely what we want to avoid.
733 735
736@defvar this-original-command
737This has the same value as @code{this-command} except when command
738remapping occurs (@pxref{Remapping Commands}). In that case,
739@code{this-command} gives the command actually run (the result of
740remapping), and @code{this-original-command} gives the command that
741was specified to run but remapped into another command.
742@end defvar
743
734@defun this-command-keys 744@defun this-command-keys
735This function returns a string or vector containing the key sequence 745This function returns a string or vector containing the key sequence
736that invoked the present command, plus any previous commands that 746that invoked the present command, plus any previous commands that