]> code.delx.au - gnu-emacs/commitdiff
Document 'funcall-interactively'
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2016 14:54:35 +0000 (16:54 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2016 14:54:35 +0000 (16:54 +0200)
* doc/lispref/commands.texi (Interactive Call): Document
'funcall-interactively'.
* doc/lispref/functions.texi (Calling Functions): Mention
'funcall-interactively' and provide a cross-reference.

doc/lispref/commands.texi
doc/lispref/functions.texi
etc/NEWS

index dee43cefb15ef7464fbf9bf328c5b55455d2ab1f..9c1df8951619869821559b498ce9ebd6f379601b 100644 (file)
@@ -691,6 +691,14 @@ default is the return value of @code{this-command-keys-vector}.
 @xref{Definition of this-command-keys-vector}.
 @end defun
 
+@defun funcall-interactively function &rest arguments
+This function works like @code{funcall} (@pxref{Calling Functions}),
+but it makes the call look like an interactive invocation: a call to
+@code{called-interactively-p} inside @var{function} will return
+@code{t}.  If @var{function} is not a command, it is called without
+signaling an error.
+@end defun
+
 @defun command-execute command &optional record-flag keys special
 @cindex keyboard macro execution
 This function executes @var{command}.  The argument @var{command} must
index d3d0a422574584b6e812a0428961a48ebd034f22..1e8e7540395daa9c116bebff4e9918b4517b523e 100644 (file)
@@ -754,6 +754,10 @@ they make sense only when given the unevaluated argument
 expressions.  @code{funcall} cannot provide these because, as we saw
 above, it never knows them in the first place.
 
+If you need to use @code{funcall} to call a command and make it behave
+as if invoked interactively, use @code{funcall-interactively}
+(@pxref{Interactive Call}).
+
 @example
 @group
 (setq f 'list)
index 01a8490023ad4314c1c4d5b2b0fbe3b24bd404ad..6735718b63c51c452f89d355d41fd519009872a3 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1467,6 +1467,7 @@ MS-Windows doesn't support UTF-8 as codeset in its locales.
 +++
 ** New function `alist-get', which is also a valid place (aka lvalue).
 
++++
 ** New function `funcall-interactively', which works like `funcall'
 but makes `called-interactively-p' treat the function as (you guessed it)
 called interactively.