aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2009-03-22 15:12:01 +0000
committerAlan Mackenzie2009-03-22 15:12:01 +0000
commit9fa6d4555728f809912350e477f662df1e57b06f (patch)
tree6a95b5ff5dd6da87a0f871431f44e4a0d03c62e8
parentf9257eedc921c9536cd30b132043cf4636bf9c51 (diff)
downloademacs-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.texi24
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
158or more arguments. 158or more arguments.
159 159
160@item 160@item
161It may be a string; then its contents should consist of a code character 161It may be a string; its contents are a sequence of elements separated
162followed by a prompt (which some code characters use and some ignore). 162by newlines, one for each parameter@footnote{Some elements actually
163The prompt ends either with the end of the string or with a newline. 163supply two parameters.}. Each element consists of a code character
164Here is a simple example: 164(@pxref{ Interactive Codes}) optionally followed by a prompt (which
165some 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
171The code letter @samp{b} says to read the name of an existing buffer, 172The code letter @samp{P} sets the command's first argument to the raw
172with completion. The buffer name is the sole argument passed to the 173command prefix (@pxref{Prefix Command Arguments}). @samp{bFrobnicate
173command. The rest of the string is a prompt. 174buffer: } prompts the user with @samp{Frobnicate buffer: } to enter
174 175the name of an existing buffer, which becomes the second and final
175If there is a newline character in the string, it terminates the prompt. 176argument.
176If the string does not end there, then the rest of the string should
177contain another code character and prompt, specifying another argument.
178You can specify any number of arguments in this way.
179 177
180@c Emacs 19 feature 178@c Emacs 19 feature
181The prompt string can use @samp{%} to include previous argument values 179The prompt string can use @samp{%} to include previous argument values