changeset 57827:69ecb96f8494

(Interactive Call): Add called-interactively-p.
author Richard M. Stallman <rms@gnu.org>
date Mon, 01 Nov 2004 07:47:08 +0000
parents 26b411f0feaf
children 7957cb0def89
files lispref/commands.texi
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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