diff options
| author | Juri Linkov | 2007-10-22 00:30:11 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-10-22 00:30:11 +0000 |
| commit | c066bafa71c1bd20846a4c4ab60f65a42a4f9e9b (patch) | |
| tree | e54ccd4974999dcfa584910448be4088b70de327 /doc | |
| parent | eabd84c93d40b8b182e65183faee011dde9a412f (diff) | |
| download | emacs-c066bafa71c1bd20846a4c4ab60f65a42a4f9e9b.tar.gz emacs-c066bafa71c1bd20846a4c4ab60f65a42a4f9e9b.zip | |
(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.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 45 |
2 files changed, 33 insertions, 19 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index e0d9db962f9..164f8e27023 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-10-22 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * minibuf.texi (Text from Minibuffer, Minibuffer Completion) | ||
| 4 | (High-Level Completion): Document a list of default value strings | ||
| 5 | in the DEFAULT argument, for which minibuffer functions return the | ||
| 6 | first element. | ||
| 7 | |||
| 1 | 2007-10-17 Juri Linkov <juri@jurta.org> | 8 | 2007-10-17 Juri Linkov <juri@jurta.org> |
| 2 | 9 | ||
| 3 | * text.texi (Filling): Update arguments of fill-paragraph. | 10 | * text.texi (Filling): Update arguments of fill-paragraph. |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 8252b42ca94..6561460d1f9 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -129,8 +129,8 @@ reads the text and returns the resulting Lisp object, unevaluated. | |||
| 129 | (@xref{Input Functions}, for information about reading.) | 129 | (@xref{Input Functions}, for information about reading.) |
| 130 | 130 | ||
| 131 | The argument @var{default} specifies a default value to make available | 131 | The argument @var{default} specifies a default value to make available |
| 132 | through the history commands. It should be a string, or @code{nil}. | 132 | through the history commands. It should be a string, a list of strings, |
| 133 | If non-@code{nil}, the user can access it using | 133 | or @code{nil}. If non-@code{nil}, the user can access its values using |
| 134 | @code{next-history-element}, usually bound in the minibuffer to | 134 | @code{next-history-element}, usually bound in the minibuffer to |
| 135 | @kbd{M-n}. If @var{read} is non-@code{nil}, then @var{default} is | 135 | @kbd{M-n}. If @var{read} is non-@code{nil}, then @var{default} is |
| 136 | also used as the input to @code{read}, if the user enters empty input. | 136 | 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 | The optional argument @var{default} is used as in | 176 | The optional argument @var{default} is used as in |
| 177 | @code{read-from-minibuffer}, except that, if non-@code{nil}, it also | 177 | @code{read-from-minibuffer}, except that, if non-@code{nil}, it also |
| 178 | specifies a default value to return if the user enters null input. As | 178 | specifies a default value to return if the user enters null input. As |
| 179 | in @code{read-from-minibuffer} it should be a string, or @code{nil}, | 179 | in @code{read-from-minibuffer} it should be a string, a list of strings, |
| 180 | which is equivalent to an empty string. | 180 | or @code{nil}, which is equivalent to an empty string. When @var{default} |
| 181 | is a list of strings, it returns the first element of this list. | ||
| 181 | 182 | ||
| 182 | This function is a simplified interface to the | 183 | This function is a simplified interface to the |
| 183 | @code{read-from-minibuffer} function: | 184 | @code{read-from-minibuffer} function: |
| @@ -190,7 +191,7 @@ This function is a simplified interface to the | |||
| 190 | (read-from-minibuffer @var{prompt} @var{initial} nil nil | 191 | (read-from-minibuffer @var{prompt} @var{initial} nil nil |
| 191 | @var{history} @var{default} @var{inherit}))) | 192 | @var{history} @var{default} @var{inherit}))) |
| 192 | (if (and (equal value "") @var{default}) | 193 | (if (and (equal value "") @var{default}) |
| 193 | @var{default} | 194 | (if (consp @var{default}) (car @var{default}) @var{default}) |
| 194 | value)) | 195 | value)) |
| 195 | @end group | 196 | @end group |
| 196 | @end smallexample | 197 | @end smallexample |
| @@ -840,9 +841,10 @@ input already in the buffer matches an element of @var{collection}. | |||
| 840 | 841 | ||
| 841 | However, empty input is always permitted, regardless of the value of | 842 | However, empty input is always permitted, regardless of the value of |
| 842 | @var{require-match}; in that case, @code{completing-read} returns | 843 | @var{require-match}; in that case, @code{completing-read} returns |
| 843 | @var{default}, or @code{""}, if @var{default} is @code{nil}. The | 844 | the first element of @var{default}, if it is a list, @code{""}, |
| 844 | value of @var{default} (if non-@code{nil}) is also available to the | 845 | if @var{default} is @code{nil}, or @var{default}. The value of |
| 845 | user through the history commands. | 846 | @var{default} (if non-@code{nil}) is also available to the user |
| 847 | through the history commands. | ||
| 846 | 848 | ||
| 847 | The function @code{completing-read} uses | 849 | The function @code{completing-read} uses |
| 848 | @code{minibuffer-local-completion-map} as the keymap if | 850 | @code{minibuffer-local-completion-map} as the keymap if |
| @@ -1073,8 +1075,10 @@ specification. @xref{Defining Commands}. | |||
| 1073 | This function reads the name of a buffer and returns it as a string. | 1075 | This function reads the name of a buffer and returns it as a string. |
| 1074 | The argument @var{default} is the default name to use, the value to | 1076 | The argument @var{default} is the default name to use, the value to |
| 1075 | return if the user exits with an empty minibuffer. If non-@code{nil}, | 1077 | return if the user exits with an empty minibuffer. If non-@code{nil}, |
| 1076 | it should be a string or a buffer. It is mentioned in the prompt, but | 1078 | it should be a string, a list of strings, or a buffer. If it is |
| 1077 | is not inserted in the minibuffer as initial input. | 1079 | a list, the default value is the first element of this list. It is |
| 1080 | mentioned in the prompt, but is not inserted in the minibuffer as | ||
| 1081 | initial input. | ||
| 1078 | 1082 | ||
| 1079 | The argument @var{prompt} should be a string ending with a colon and a | 1083 | The argument @var{prompt} should be a string ending with a colon and a |
| 1080 | space. If @var{default} is non-@code{nil}, the function inserts it in | 1084 | 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 | for which @code{commandp} returns @code{t}. @xref{Interactive Call}. | 1134 | for which @code{commandp} returns @code{t}. @xref{Interactive Call}. |
| 1131 | 1135 | ||
| 1132 | The argument @var{default} specifies what to return if the user enters | 1136 | The argument @var{default} specifies what to return if the user enters |
| 1133 | null input. It can be a symbol or a string; if it is a string, | 1137 | null input. It can be a symbol, a string or a list of strings. If it |
| 1134 | @code{read-command} interns it before returning it. If @var{default} is | 1138 | is a string, @code{read-command} interns it before returning it. |
| 1135 | @code{nil}, that means no default has been specified; then if the user | 1139 | If it is a list, @code{read-command} returns the first element of this list. |
| 1136 | enters null input, the return value is @code{(intern "")}, that is, a | 1140 | If @var{default} is @code{nil}, that means no default has been |
| 1137 | symbol whose name is an empty string. | 1141 | specified; then if the user enters null input, the return value is |
| 1142 | @code{(intern "")}, that is, a symbol whose name is an empty string. | ||
| 1138 | 1143 | ||
| 1139 | @example | 1144 | @example |
| 1140 | (read-command "Command name? ") | 1145 | (read-command "Command name? ") |
| @@ -1177,10 +1182,12 @@ This function reads the name of a user variable and returns it as a | |||
| 1177 | symbol. | 1182 | symbol. |
| 1178 | 1183 | ||
| 1179 | The argument @var{default} specifies what to return if the user enters | 1184 | The argument @var{default} specifies what to return if the user enters |
| 1180 | null input. It can be a symbol or a string; if it is a string, | 1185 | null input. It can be a symbol, a string or a list of strings. If it |
| 1181 | @code{read-variable} interns it before returning it. If @var{default} | 1186 | is a string, @code{read-variable} interns it before returning it. |
| 1182 | is @code{nil}, that means no default has been specified; then if the | 1187 | If it is a list, @code{read-variable} returns the first element of |
| 1183 | user enters null input, the return value is @code{(intern "")}. | 1188 | this list. If @var{default} is @code{nil}, that means no default has |
| 1189 | been specified; then if the user enters null input, the return value | ||
| 1190 | is @code{(intern "")}. | ||
| 1184 | 1191 | ||
| 1185 | @example | 1192 | @example |
| 1186 | @group | 1193 | @group |