diff options
| author | Eli Zaretskii | 2008-10-18 13:14:59 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-18 13:14:59 +0000 |
| commit | 6d4913f0d38434ae3998ef0e2a791eccba135e98 (patch) | |
| tree | 06ddfaf50778542a8dc120412318f86f70d33ba1 | |
| parent | 43c59a3dca02f712c5e69c3d4be56d2353eb967b (diff) | |
| download | emacs-6d4913f0d38434ae3998ef0e2a791eccba135e98.tar.gz emacs-6d4913f0d38434ae3998ef0e2a791eccba135e98.zip | |
(Text from Minibuffer): Document `read-regexp'.
(Completion Commands, Reading File Names): Rename
`minibuffer-local-must-match-filename-map' to
`minibuffer-local-filename-must-match-map'.
(Minibuffer Completion): The `require-match' argument to `completing-read'
can now have the value `confirm-only'.
| -rw-r--r-- | doc/lispref/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 55 | ||||
| -rw-r--r-- | etc/NEWS | 3 |
3 files changed, 57 insertions, 8 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index cc74a973792..7e1ba05893b 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2008-10-18 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-10-18 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * minibuf.texi (Text from Minibuffer): Document `read-regexp'. | ||
| 4 | (Completion Commands, Reading File Names): Rename | ||
| 5 | `minibuffer-local-must-match-filename-map' to | ||
| 6 | `minibuffer-local-filename-must-match-map'. | ||
| 7 | (Minibuffer Completion): The `require-match' argument to | ||
| 8 | `completing-read' can now have the value `confirm-only'. | ||
| 9 | |||
| 3 | * windows.texi (Displaying Buffers): Minor wording fix. | 10 | * windows.texi (Displaying Buffers): Minor wording fix. |
| 4 | (Choosing Window): `split-height-threshold' can now be nil. | 11 | (Choosing Window): `split-height-threshold' can now be nil. |
| 5 | Document `split-width-threshold'. `pop-up-frames' can have the | 12 | Document `split-width-threshold'. `pop-up-frames' can have the |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index a5076a2b7e4..55b6f77262a 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -101,9 +101,11 @@ was supplied when Emacs was started. | |||
| 101 | 101 | ||
| 102 | Most often, the minibuffer is used to read text as a string. It can | 102 | Most often, the minibuffer is used to read text as a string. It can |
| 103 | also be used to read a Lisp object in textual form. The most basic | 103 | also be used to read a Lisp object in textual form. The most basic |
| 104 | primitive for minibuffer input is @code{read-from-minibuffer}; it can do | 104 | primitive for minibuffer input is @code{read-from-minibuffer}; it can |
| 105 | either one. There are also specialized commands for reading | 105 | do either one. Regular expressions (@pxref{Regular Expressions}) are |
| 106 | commands, variables, file names, etc. (@pxref{Completion}). | 106 | a special kind of strings; use @code{read-regexp} for their minibuffer |
| 107 | input. There are also specialized commands for reading commands, | ||
| 108 | variables, file names, etc.@: (@pxref{Completion}). | ||
| 107 | 109 | ||
| 108 | In most cases, you should not call minibuffer input functions in the | 110 | In most cases, you should not call minibuffer input functions in the |
| 109 | middle of a Lisp function. Instead, do all minibuffer input as part of | 111 | middle of a Lisp function. Instead, do all minibuffer input as part of |
| @@ -201,6 +203,40 @@ This function works by calling the | |||
| 201 | @end smallexample | 203 | @end smallexample |
| 202 | @end defun | 204 | @end defun |
| 203 | 205 | ||
| 206 | @defun read-regexp prompt &optional default | ||
| 207 | This function reads a regular expression as a string from the | ||
| 208 | minibuffer and returns it. The argument @var{prompt} is used as in | ||
| 209 | @code{read-from-minibuffer}. The keymap used is | ||
| 210 | @code{minibuffer-local-map}, and @code{regexp-history} is used as the | ||
| 211 | history list (@pxref{Minibuffer History, regexp-history}). | ||
| 212 | |||
| 213 | The optional argument @var{default}, if non-@code{nil}, specifies a | ||
| 214 | default value to return if the user enters null input. As | ||
| 215 | in @code{read-from-minibuffer} it should be a string, a list of | ||
| 216 | strings, or @code{nil} which is equivalent to an empty string. When | ||
| 217 | @var{default} is a string, that string is the default value. When it | ||
| 218 | is a list of strings, the first string is the default value. To this | ||
| 219 | default @code{read-regexp} adds a few other useful candidates, and | ||
| 220 | passes them to @code{read-from-minibuffer} to make them available to | ||
| 221 | the user as the ``future minibuffer history list'' (@pxref{Minibuffer | ||
| 222 | History, future list,, emacs, The GNU Emacs Manual}). These | ||
| 223 | candidates are: | ||
| 224 | |||
| 225 | @itemize @minus | ||
| 226 | @item | ||
| 227 | The Word or symbol at point. | ||
| 228 | @item | ||
| 229 | The last regexp used in an incremental search. | ||
| 230 | @item | ||
| 231 | The last string used in an incremental search. | ||
| 232 | @item | ||
| 233 | The last string or pattern used in query-replace commands. | ||
| 234 | @end itemize | ||
| 235 | |||
| 236 | This function works by calling the @code{read-from-minibuffer} | ||
| 237 | function, after computing the list of defaults as described above. | ||
| 238 | @end defun | ||
| 239 | |||
| 204 | @defvar minibuffer-allow-text-properties | 240 | @defvar minibuffer-allow-text-properties |
| 205 | If this variable is @code{nil}, then @code{read-from-minibuffer} strips | 241 | If this variable is @code{nil}, then @code{read-from-minibuffer} strips |
| 206 | all text properties from the minibuffer input before returning it. | 242 | all text properties from the minibuffer input before returning it. |
| @@ -839,9 +875,12 @@ of test-completion}. | |||
| 839 | If @var{require-match} is @code{nil}, the exit commands work regardless | 875 | If @var{require-match} is @code{nil}, the exit commands work regardless |
| 840 | of the input in the minibuffer. If @var{require-match} is @code{t}, the | 876 | of the input in the minibuffer. If @var{require-match} is @code{t}, the |
| 841 | usual minibuffer exit commands won't exit unless the input completes to | 877 | usual minibuffer exit commands won't exit unless the input completes to |
| 842 | an element of @var{collection}. If @var{require-match} is neither | 878 | an element of @var{collection}. If @var{require-match} is |
| 843 | @code{nil} nor @code{t}, then the exit commands won't exit unless the | 879 | @code{confirm-only}, the user can exit with any input, but she will |
| 844 | input already in the buffer matches an element of @var{collection}. | 880 | asked for a confirmation if the input is not an element of |
| 881 | @var{collection}. Any other value of @var{require-match} behaves like | ||
| 882 | @code{t}, except that the exit commands won't exit if it does non-null | ||
| 883 | completion. | ||
| 845 | 884 | ||
| 846 | However, empty input is always permitted, regardless of the value of | 885 | However, empty input is always permitted, regardless of the value of |
| 847 | @var{require-match}; in that case, @code{completing-read} returns the | 886 | @var{require-match}; in that case, @code{completing-read} returns the |
| @@ -1058,7 +1097,7 @@ except that it does not bind @key{SPC}. This keymap is used by the | |||
| 1058 | function @code{read-file-name}. | 1097 | function @code{read-file-name}. |
| 1059 | @end defvar | 1098 | @end defvar |
| 1060 | 1099 | ||
| 1061 | @defvar minibuffer-local-must-match-filename-map | 1100 | @defvar minibuffer-local-filename-must-match-map |
| 1062 | This is like @code{minibuffer-local-must-match-map} | 1101 | This is like @code{minibuffer-local-must-match-map} |
| 1063 | except that it does not bind @key{SPC}. This keymap is used by the | 1102 | except that it does not bind @key{SPC}. This keymap is used by the |
| 1064 | function @code{read-file-name}. | 1103 | function @code{read-file-name}. |
| @@ -1257,7 +1296,7 @@ acceptable. | |||
| 1257 | @code{read-file-name} uses | 1296 | @code{read-file-name} uses |
| 1258 | @code{minibuffer-local-filename-completion-map} as the keymap if | 1297 | @code{minibuffer-local-filename-completion-map} as the keymap if |
| 1259 | @var{existing} is @code{nil}, and uses | 1298 | @var{existing} is @code{nil}, and uses |
| 1260 | @code{minibuffer-local-must-match-filename-map} if @var{existing} is | 1299 | @code{minibuffer-local-filename-must-match-map} if @var{existing} is |
| 1261 | non-@code{nil}. @xref{Completion Commands}. | 1300 | non-@code{nil}. @xref{Completion Commands}. |
| 1262 | 1301 | ||
| 1263 | The argument @var{directory} specifies the directory to use for | 1302 | The argument @var{directory} specifies the directory to use for |
| @@ -1247,10 +1247,12 @@ functions `read-from-minibuffer', `read-string', `read-command', | |||
| 1247 | are available for inserting into the minibuffer by typing `M-n'. | 1247 | are available for inserting into the minibuffer by typing `M-n'. |
| 1248 | For empty input these functions return the first element of this list. | 1248 | For empty input these functions return the first element of this list. |
| 1249 | 1249 | ||
| 1250 | +++ | ||
| 1250 | *** New function `read-regexp' uses the regexp history and some useful | 1251 | *** New function `read-regexp' uses the regexp history and some useful |
| 1251 | regexp defaults (string at point, last Isearch/replacement regexp/string) | 1252 | regexp defaults (string at point, last Isearch/replacement regexp/string) |
| 1252 | via M-n when reading a regexp in the minibuffer. | 1253 | via M-n when reading a regexp in the minibuffer. |
| 1253 | 1254 | ||
| 1255 | +++ | ||
| 1254 | *** minibuffer-local-must-match-filename-map is now named | 1256 | *** minibuffer-local-must-match-filename-map is now named |
| 1255 | minibuffer-local-filename-must-match-map. | 1257 | minibuffer-local-filename-must-match-map. |
| 1256 | 1258 | ||
| @@ -1259,6 +1261,7 @@ Since this means the returned list is not properly nil-terminated, this | |||
| 1259 | is an incompatible change and is thus enabled by the new variable | 1261 | is an incompatible change and is thus enabled by the new variable |
| 1260 | completion-all-completions-with-base-size. | 1262 | completion-all-completions-with-base-size. |
| 1261 | 1263 | ||
| 1264 | +++ | ||
| 1262 | *** The `require-match' argument to `completing-read' accepts a new value | 1265 | *** The `require-match' argument to `completing-read' accepts a new value |
| 1263 | `confirm-only'. | 1266 | `confirm-only'. |
| 1264 | 1267 | ||