diff options
| author | Alan Mackenzie | 2009-03-22 15:12:01 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2009-03-22 15:12:01 +0000 |
| commit | 9fa6d4555728f809912350e477f662df1e57b06f (patch) | |
| tree | 6a95b5ff5dd6da87a0f871431f44e4a0d03c62e8 | |
| parent | f9257eedc921c9536cd30b132043cf4636bf9c51 (diff) | |
| download | emacs-9fa6d4555728f809912350e477f662df1e57b06f.tar.gz emacs-9fa6d4555728f809912350e477f662df1e57b06f.zip | |
(Using Interactive): Clarify string argument to `interactive' - even
promptless elements need \n separators.
| -rw-r--r-- | doc/lispref/commands.texi | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index ea169da6eb0..270f3924298 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -158,24 +158,22 @@ arguments. This leads quickly to an error if the command requires one | |||
| 158 | or more arguments. | 158 | or more arguments. |
| 159 | 159 | ||
| 160 | @item | 160 | @item |
| 161 | It may be a string; then its contents should consist of a code character | 161 | It may be a string; its contents are a sequence of elements separated |
| 162 | followed by a prompt (which some code characters use and some ignore). | 162 | by newlines, one for each parameter@footnote{Some elements actually |
| 163 | The prompt ends either with the end of the string or with a newline. | 163 | supply two parameters.}. Each element consists of a code character |
| 164 | Here is a simple example: | 164 | (@pxref{ Interactive Codes}) optionally followed by a prompt (which |
| 165 | some code characters use and some ignore). Here is an example: | ||
| 165 | 166 | ||
| 166 | @smallexample | 167 | @smallexample |
| 167 | (interactive "bFrobnicate buffer: ") | 168 | (interactive "P\nbFrobnicate buffer: ") |
| 168 | @end smallexample | 169 | @end smallexample |
| 169 | 170 | ||
| 170 | @noindent | 171 | @noindent |
| 171 | The code letter @samp{b} says to read the name of an existing buffer, | 172 | The code letter @samp{P} sets the command's first argument to the raw |
| 172 | with completion. The buffer name is the sole argument passed to the | 173 | command prefix (@pxref{Prefix Command Arguments}). @samp{bFrobnicate |
| 173 | command. The rest of the string is a prompt. | 174 | buffer: } prompts the user with @samp{Frobnicate buffer: } to enter |
| 174 | 175 | the name of an existing buffer, which becomes the second and final | |
| 175 | If there is a newline character in the string, it terminates the prompt. | 176 | argument. |
| 176 | If the string does not end there, then the rest of the string should | ||
| 177 | contain another code character and prompt, specifying another argument. | ||
| 178 | You can specify any number of arguments in this way. | ||
| 179 | 177 | ||
| 180 | @c Emacs 19 feature | 178 | @c Emacs 19 feature |
| 181 | The prompt string can use @samp{%} to include previous argument values | 179 | The prompt string can use @samp{%} to include previous argument values |