Document 'funcall-interactively'

* doc/lispref/commands.texi (Interactive Call): Document
'funcall-interactively'.
* doc/lispref/functions.texi (Calling Functions): Mention
'funcall-interactively' and provide a cross-reference.
This commit is contained in:
Eli Zaretskii 2016-01-16 16:54:35 +02:00
parent 2460cfac09
commit 964ba0f526
3 changed files with 13 additions and 0 deletions

View 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

View 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)

View file

@ -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.