From: Richard M. Stallman Date: Mon, 1 Nov 2004 07:47:08 +0000 (+0000) Subject: (Interactive Call): Add called-interactively-p. X-Git-Tag: ttn-vms-21-2-B4~4290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9d0d10708496729d062ae04fe2f191c16dc831b3;p=emacs.git (Interactive Call): Add called-interactively-p. --- diff --git a/lispref/commands.texi b/lispref/commands.texi index f1f94e11838..3c9612e5186 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi @@ -617,7 +617,7 @@ This function returns @code{t} if the containing function (the one whose code includes the call to @code{interactive-p}) was called in direct response to user input. This means that it was called with the function @code{call-interactively}, and that a keyboard macro is -not running. +not running, and that Emacs is not running in batch mode. If the containing function was called by Lisp evaluation (or with @code{apply} or @code{funcall}), then it was not called interactively. @@ -679,6 +679,15 @@ Defined in this way, the function does display the message when called from a keyboard macro. We use @code{"p"} because the numeric prefix argument is never @code{nil}. +@defun called-interactively-p +This function returns @code{t} when the calling function was called +using @code{call-interactively}. + +When possible, instead of using this function, you should use the +method in the example above; that method makes it possible for a +caller to ``pretend'' that the function was called interactively. +@end defun + @node Command Loop Info @comment node-name, next, previous, up @section Information from the Command Loop