aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2011-07-07 18:59:26 +0200
committerLars Magne Ingebrigtsen2011-07-07 18:59:26 +0200
commit54e101844312f87d5283db5fd078d0756264caa2 (patch)
tree0f0fc3253456a7834742ec13f71f27c216d05993
parentac6531adfffc5bc6729a9f481ce4bc60800c4d68 (diff)
downloademacs-54e101844312f87d5283db5fd078d0756264caa2.tar.gz
emacs-54e101844312f87d5283db5fd078d0756264caa2.zip
Clarify the `call-interactively' doc string, and add an example.
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/commands.texi33
-rw-r--r--src/ChangeLog5
-rw-r--r--src/callint.c2
4 files changed, 37 insertions, 8 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 23ddf0c5ad1..773321f3c67 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * commands.texi (Interactive Call): Add a `call-interactively'
4 example (bug#1010).
5
12011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org> 62011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 7
3 * functions.texi (Calling Functions): Link to the "Interactive 8 * functions.texi (Calling Functions): Link to the "Interactive
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index eb42ddb11a4..dccc2fa571c 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -597,13 +597,32 @@ realistic example of using @code{commandp}.
597 597
598@defun call-interactively command &optional record-flag keys 598@defun call-interactively command &optional record-flag keys
599This function calls the interactively callable function @var{command}, 599This function calls the interactively callable function @var{command},
600reading arguments according to its interactive calling specifications. 600providing arguments according to its interactive calling specifications.
601It returns whatever @var{command} returns. An error is signaled if 601It returns whatever @var{command} returns.
602@var{command} is not a function or if it cannot be called 602
603interactively (i.e., is not a command). Note that keyboard macros 603If, for instance, you have a function with the following signature:
604(strings and vectors) are not accepted, even though they are 604
605considered commands, because they are not functions. If @var{command} 605@example
606is a symbol, then @code{call-interactively} uses its function definition. 606(defun foo (begin end)
607 (interactive "r")
608 ...)
609@end example
610
611then saying
612
613@example
614(call-interactively 'foo)
615@end example
616
617will call @code{foo} with the region (@code{point} and @code{mark}) as
618the arguments.
619
620An error is signaled if @var{command} is not a function or if it
621cannot be called interactively (i.e., is not a command). Note that
622keyboard macros (strings and vectors) are not accepted, even though
623they are considered commands, because they are not functions. If
624@var{command} is a symbol, then @code{call-interactively} uses its
625function definition.
607 626
608@cindex record command history 627@cindex record command history
609If @var{record-flag} is non-@code{nil}, then this command and its 628If @var{record-flag} is non-@code{nil}, then this command and its
diff --git a/src/ChangeLog b/src/ChangeLog
index 9186061530e..8c1af2a27ce 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * callint.c (Fcall_interactively): Change "reading args" to
4 "providing args" to try to clarify what it does (bug#1010).
5
12011-07-07 Kenichi Handa <handa@m17n.org> 62011-07-07 Kenichi Handa <handa@m17n.org>
2 7
3 * composite.c (composition_compute_stop_pos): Ignore a static 8 * composite.c (composition_compute_stop_pos): Ignore a static
diff --git a/src/callint.c b/src/callint.c
index 1371b403e4b..26b161a25b3 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -234,7 +234,7 @@ fix_command (Lisp_Object input, Lisp_Object values)
234} 234}
235 235
236DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0, 236DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0,
237 doc: /* Call FUNCTION, reading args according to its interactive calling specs. 237 doc: /* Call FUNCTION, providing args according to its interactive calling specs.
238Return the value FUNCTION returns. 238Return the value FUNCTION returns.
239The function contains a specification of how to do the argument reading. 239The function contains a specification of how to do the argument reading.
240In the case of user-defined functions, this is specified by placing a call 240In the case of user-defined functions, this is specified by placing a call