# HG changeset patch # User Richard M. Stallman # Date 1099295228 0 # Node ID 69ecb96f849465204488604e7a2362bd21bb533d # Parent 26b411f0feaf01b0512884033b29926891a5ad67 (Interactive Call): Add called-interactively-p. diff -r 26b411f0feaf -r 69ecb96f8494 lispref/commands.texi --- a/lispref/commands.texi Mon Nov 01 07:46:16 2004 +0000 +++ b/lispref/commands.texi Mon Nov 01 07:47:08 2004 +0000 @@ -617,7 +617,7 @@ 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 @@ 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