diff options
| author | Lars Magne Ingebrigtsen | 2011-07-07 18:59:26 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2011-07-07 18:59:26 +0200 |
| commit | 54e101844312f87d5283db5fd078d0756264caa2 (patch) | |
| tree | 0f0fc3253456a7834742ec13f71f27c216d05993 /doc | |
| parent | ac6531adfffc5bc6729a9f481ce4bc60800c4d68 (diff) | |
| download | emacs-54e101844312f87d5283db5fd078d0756264caa2.tar.gz emacs-54e101844312f87d5283db5fd078d0756264caa2.zip | |
Clarify the `call-interactively' doc string, and add an example.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 33 |
2 files changed, 31 insertions, 7 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 @@ | |||
| 1 | 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * commands.texi (Interactive Call): Add a `call-interactively' | ||
| 4 | example (bug#1010). | ||
| 5 | |||
| 1 | 2011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org> | 6 | 2011-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 |
| 599 | This function calls the interactively callable function @var{command}, | 599 | This function calls the interactively callable function @var{command}, |
| 600 | reading arguments according to its interactive calling specifications. | 600 | providing arguments according to its interactive calling specifications. |
| 601 | It returns whatever @var{command} returns. An error is signaled if | 601 | It returns whatever @var{command} returns. |
| 602 | @var{command} is not a function or if it cannot be called | 602 | |
| 603 | interactively (i.e., is not a command). Note that keyboard macros | 603 | If, for instance, you have a function with the following signature: |
| 604 | (strings and vectors) are not accepted, even though they are | 604 | |
| 605 | considered commands, because they are not functions. If @var{command} | 605 | @example |
| 606 | is a symbol, then @code{call-interactively} uses its function definition. | 606 | (defun foo (begin end) |
| 607 | (interactive "r") | ||
| 608 | ...) | ||
| 609 | @end example | ||
| 610 | |||
| 611 | then saying | ||
| 612 | |||
| 613 | @example | ||
| 614 | (call-interactively 'foo) | ||
| 615 | @end example | ||
| 616 | |||
| 617 | will call @code{foo} with the region (@code{point} and @code{mark}) as | ||
| 618 | the arguments. | ||
| 619 | |||
| 620 | An error is signaled if @var{command} is not a function or if it | ||
| 621 | cannot be called interactively (i.e., is not a command). Note that | ||
| 622 | keyboard macros (strings and vectors) are not accepted, even though | ||
| 623 | they are considered commands, because they are not functions. If | ||
| 624 | @var{command} is a symbol, then @code{call-interactively} uses its | ||
| 625 | function definition. | ||
| 607 | 626 | ||
| 608 | @cindex record command history | 627 | @cindex record command history |
| 609 | If @var{record-flag} is non-@code{nil}, then this command and its | 628 | If @var{record-flag} is non-@code{nil}, then this command and its |