Commit c066bafa authored by Juri Linkov's avatar Juri Linkov
Browse files

(Text from Minibuffer, Minibuffer Completion, High-Level Completion):

Document a list of default value strings in the DEFAULT argument,
for which minibuffer functions return the first element.
parent eabd84c9
2007-10-22 Juri Linkov <juri@jurta.org>
* minibuf.texi (Text from Minibuffer, Minibuffer Completion)
(High-Level Completion): Document a list of default value strings
in the DEFAULT argument, for which minibuffer functions return the
first element.
2007-10-17 Juri Linkov <juri@jurta.org> 2007-10-17 Juri Linkov <juri@jurta.org>
* text.texi (Filling): Update arguments of fill-paragraph. * text.texi (Filling): Update arguments of fill-paragraph.
......
...@@ -129,8 +129,8 @@ reads the text and returns the resulting Lisp object, unevaluated. ...@@ -129,8 +129,8 @@ reads the text and returns the resulting Lisp object, unevaluated.
(@xref{Input Functions}, for information about reading.) (@xref{Input Functions}, for information about reading.)
The argument @var{default} specifies a default value to make available The argument @var{default} specifies a default value to make available
through the history commands. It should be a string, or @code{nil}. through the history commands. It should be a string, a list of strings,
If non-@code{nil}, the user can access it using or @code{nil}. If non-@code{nil}, the user can access its values using
@code{next-history-element}, usually bound in the minibuffer to @code{next-history-element}, usually bound in the minibuffer to
@kbd{M-n}. If @var{read} is non-@code{nil}, then @var{default} is @kbd{M-n}. If @var{read} is non-@code{nil}, then @var{default} is
also used as the input to @code{read}, if the user enters empty input. also used as the input to @code{read}, if the user enters empty input.
...@@ -176,8 +176,9 @@ The keymap used is @code{minibuffer-local-map}. ...@@ -176,8 +176,9 @@ The keymap used is @code{minibuffer-local-map}.
The optional argument @var{default} is used as in The optional argument @var{default} is used as in
@code{read-from-minibuffer}, except that, if non-@code{nil}, it also @code{read-from-minibuffer}, except that, if non-@code{nil}, it also
specifies a default value to return if the user enters null input. As specifies a default value to return if the user enters null input. As
in @code{read-from-minibuffer} it should be a string, or @code{nil}, in @code{read-from-minibuffer} it should be a string, a list of strings,
which is equivalent to an empty string. or @code{nil}, which is equivalent to an empty string. When @var{default}
is a list of strings, it returns the first element of this list.
This function is a simplified interface to the This function is a simplified interface to the
@code{read-from-minibuffer} function: @code{read-from-minibuffer} function:
...@@ -190,7 +191,7 @@ This function is a simplified interface to the ...@@ -190,7 +191,7 @@ This function is a simplified interface to the
(read-from-minibuffer @var{prompt} @var{initial} nil nil (read-from-minibuffer @var{prompt} @var{initial} nil nil
@var{history} @var{default} @var{inherit}))) @var{history} @var{default} @var{inherit})))
(if (and (equal value "") @var{default}) (if (and (equal value "") @var{default})
@var{default} (if (consp @var{default}) (car @var{default}) @var{default})
value)) value))
@end group @end group
@end smallexample @end smallexample
...@@ -840,9 +841,10 @@ input already in the buffer matches an element of @var{collection}. ...@@ -840,9 +841,10 @@ input already in the buffer matches an element of @var{collection}.
However, empty input is always permitted, regardless of the value of However, empty input is always permitted, regardless of the value of
@var{require-match}; in that case, @code{completing-read} returns @var{require-match}; in that case, @code{completing-read} returns
@var{default}, or @code{""}, if @var{default} is @code{nil}. The the first element of @var{default}, if it is a list, @code{""},
value of @var{default} (if non-@code{nil}) is also available to the if @var{default} is @code{nil}, or @var{default}. The value of
user through the history commands. @var{default} (if non-@code{nil}) is also available to the user
through the history commands.
The function @code{completing-read} uses The function @code{completing-read} uses
@code{minibuffer-local-completion-map} as the keymap if @code{minibuffer-local-completion-map} as the keymap if
...@@ -1073,8 +1075,10 @@ specification. @xref{Defining Commands}. ...@@ -1073,8 +1075,10 @@ specification. @xref{Defining Commands}.
This function reads the name of a buffer and returns it as a string. This function reads the name of a buffer and returns it as a string.
The argument @var{default} is the default name to use, the value to The argument @var{default} is the default name to use, the value to
return if the user exits with an empty minibuffer. If non-@code{nil}, return if the user exits with an empty minibuffer. If non-@code{nil},
it should be a string or a buffer. It is mentioned in the prompt, but it should be a string, a list of strings, or a buffer. If it is
is not inserted in the minibuffer as initial input. a list, the default value is the first element of this list. It is
mentioned in the prompt, but is not inserted in the minibuffer as
initial input.
The argument @var{prompt} should be a string ending with a colon and a The argument @var{prompt} should be a string ending with a colon and a
space. If @var{default} is non-@code{nil}, the function inserts it in space. If @var{default} is non-@code{nil}, the function inserts it in
...@@ -1130,11 +1134,12 @@ which @code{commandp} returns @code{t}, and a command name is a symbol ...@@ -1130,11 +1134,12 @@ which @code{commandp} returns @code{t}, and a command name is a symbol
for which @code{commandp} returns @code{t}. @xref{Interactive Call}. for which @code{commandp} returns @code{t}. @xref{Interactive Call}.
The argument @var{default} specifies what to return if the user enters The argument @var{default} specifies what to return if the user enters
null input. It can be a symbol or a string; if it is a string, null input. It can be a symbol, a string or a list of strings. If it
@code{read-command} interns it before returning it. If @var{default} is is a string, @code{read-command} interns it before returning it.
@code{nil}, that means no default has been specified; then if the user If it is a list, @code{read-command} returns the first element of this list.
enters null input, the return value is @code{(intern "")}, that is, a If @var{default} is @code{nil}, that means no default has been
symbol whose name is an empty string. specified; then if the user enters null input, the return value is
@code{(intern "")}, that is, a symbol whose name is an empty string.
@example @example
(read-command "Command name? ") (read-command "Command name? ")
...@@ -1177,10 +1182,12 @@ This function reads the name of a user variable and returns it as a ...@@ -1177,10 +1182,12 @@ This function reads the name of a user variable and returns it as a
symbol. symbol.
The argument @var{default} specifies what to return if the user enters The argument @var{default} specifies what to return if the user enters
null input. It can be a symbol or a string; if it is a string, null input. It can be a symbol, a string or a list of strings. If it
@code{read-variable} interns it before returning it. If @var{default} is a string, @code{read-variable} interns it before returning it.
is @code{nil}, that means no default has been specified; then if the If it is a list, @code{read-variable} returns the first element of
user enters null input, the return value is @code{(intern "")}. this list. If @var{default} is @code{nil}, that means no default has
been specified; then if the user enters null input, the return value
is @code{(intern "")}.
@example @example
@group @group
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment