diff options
| author | Alan Mackenzie | 2009-03-22 15:09:48 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2009-03-22 15:09:48 +0000 |
| commit | f9257eedc921c9536cd30b132043cf4636bf9c51 (patch) | |
| tree | e806249c634ed012cf04b70072df081584fbfcd7 /src | |
| parent | bc9b2b5ea69d1243985836d2337b45bfa7eea14f (diff) | |
| download | emacs-f9257eedc921c9536cd30b132043cf4636bf9c51.tar.gz emacs-f9257eedc921c9536cd30b132043cf4636bf9c51.zip | |
(Finteractive): Clarify the doc string - even promptless elements need \n
separators.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callint.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/callint.c b/src/callint.c index c08cd8bf2f4..10f5f63c864 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -68,18 +68,19 @@ static Lisp_Object callint_message; | |||
| 68 | DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, | 68 | DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, |
| 69 | doc: /* Specify a way of parsing arguments for interactive use of a function. | 69 | doc: /* Specify a way of parsing arguments for interactive use of a function. |
| 70 | For example, write | 70 | For example, write |
| 71 | (defun foo (arg) "Doc string" (interactive "p") ...use arg...) | 71 | (defun foo (arg buf) "Doc string" (interactive "P\\nbbuffer: ") .... ) |
| 72 | to make ARG be the prefix argument when `foo' is called as a command. | 72 | to make ARG be the raw prefix argument, and set BUF to an existing buffer, |
| 73 | when `foo' is called as a command. | ||
| 73 | The "call" to `interactive' is actually a declaration rather than a function; | 74 | The "call" to `interactive' is actually a declaration rather than a function; |
| 74 | it tells `call-interactively' how to read arguments | 75 | it tells `call-interactively' how to read arguments |
| 75 | to pass to the function. | 76 | to pass to the function. |
| 76 | When actually called, `interactive' just returns nil. | 77 | When actually called, `interactive' just returns nil. |
| 77 | 78 | ||
| 78 | The argument of `interactive' is usually a string containing a code letter | 79 | Usually the argument of `interactive' is a string containing a code letter |
| 79 | followed by a prompt. (Some code letters do not use I/O to get | 80 | followed optionally by a prompt. (Some code letters do not use I/O to get |
| 80 | the argument and do not need prompts.) To prompt for multiple arguments, | 81 | the argument and do not use prompts.) To get several arguments, concatenate |
| 81 | give a code letter, its prompt, a newline, and another code letter, etc. | 82 | the individual strings, separating them by newline characters. |
| 82 | Prompts are passed to format, and may use % escapes to print the | 83 | Prompts are passed to format, and may use % escapes to print the |
| 83 | arguments that have already been read. | 84 | arguments that have already been read. |
| 84 | If the argument is not a string, it is evaluated to get a list of | 85 | If the argument is not a string, it is evaluated to get a list of |
| 85 | arguments to pass to the function. | 86 | arguments to pass to the function. |