aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-10-18 13:14:59 +0000
committerEli Zaretskii2008-10-18 13:14:59 +0000
commit6d4913f0d38434ae3998ef0e2a791eccba135e98 (patch)
tree06ddfaf50778542a8dc120412318f86f70d33ba1
parent43c59a3dca02f712c5e69c3d4be56d2353eb967b (diff)
downloademacs-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/ChangeLog7
-rw-r--r--doc/lispref/minibuf.texi55
-rw-r--r--etc/NEWS3
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 @@
12008-10-18 Eli Zaretskii <eliz@gnu.org> 12008-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
103also be used to read a Lisp object in textual form. The most basic 103also be used to read a Lisp object in textual form. The most basic
104primitive for minibuffer input is @code{read-from-minibuffer}; it can do 104primitive for minibuffer input is @code{read-from-minibuffer}; it can
105either one. There are also specialized commands for reading 105do either one. Regular expressions (@pxref{Regular Expressions}) are
106commands, variables, file names, etc. (@pxref{Completion}). 106a special kind of strings; use @code{read-regexp} for their minibuffer
107input. There are also specialized commands for reading commands,
108variables, 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
109middle of a Lisp function. Instead, do all minibuffer input as part of 111middle 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
207This function reads a regular expression as a string from the
208minibuffer 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
211history list (@pxref{Minibuffer History, regexp-history}).
212
213The optional argument @var{default}, if non-@code{nil}, specifies a
214default value to return if the user enters null input. As
215in @code{read-from-minibuffer} it should be a string, a list of
216strings, 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
218is a list of strings, the first string is the default value. To this
219default @code{read-regexp} adds a few other useful candidates, and
220passes them to @code{read-from-minibuffer} to make them available to
221the user as the ``future minibuffer history list'' (@pxref{Minibuffer
222History, future list,, emacs, The GNU Emacs Manual}). These
223candidates are:
224
225@itemize @minus
226@item
227The Word or symbol at point.
228@item
229The last regexp used in an incremental search.
230@item
231The last string used in an incremental search.
232@item
233The last string or pattern used in query-replace commands.
234@end itemize
235
236This function works by calling the @code{read-from-minibuffer}
237function, 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
205If this variable is @code{nil}, then @code{read-from-minibuffer} strips 241If this variable is @code{nil}, then @code{read-from-minibuffer} strips
206all text properties from the minibuffer input before returning it. 242all text properties from the minibuffer input before returning it.
@@ -839,9 +875,12 @@ of test-completion}.
839If @var{require-match} is @code{nil}, the exit commands work regardless 875If @var{require-match} is @code{nil}, the exit commands work regardless
840of the input in the minibuffer. If @var{require-match} is @code{t}, the 876of the input in the minibuffer. If @var{require-match} is @code{t}, the
841usual minibuffer exit commands won't exit unless the input completes to 877usual minibuffer exit commands won't exit unless the input completes to
842an element of @var{collection}. If @var{require-match} is neither 878an 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
844input already in the buffer matches an element of @var{collection}. 880asked 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
883completion.
845 884
846However, empty input is always permitted, regardless of the value of 885However, 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
1058function @code{read-file-name}. 1097function @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
1062This is like @code{minibuffer-local-must-match-map} 1101This is like @code{minibuffer-local-must-match-map}
1063except that it does not bind @key{SPC}. This keymap is used by the 1102except that it does not bind @key{SPC}. This keymap is used by the
1064function @code{read-file-name}. 1103function @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
1261non-@code{nil}. @xref{Completion Commands}. 1300non-@code{nil}. @xref{Completion Commands}.
1262 1301
1263The argument @var{directory} specifies the directory to use for 1302The argument @var{directory} specifies the directory to use for
diff --git a/etc/NEWS b/etc/NEWS
index b2e73354061..48e430f902b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1247,10 +1247,12 @@ functions `read-from-minibuffer', `read-string', `read-command',
1247are available for inserting into the minibuffer by typing `M-n'. 1247are available for inserting into the minibuffer by typing `M-n'.
1248For empty input these functions return the first element of this list. 1248For 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
1251regexp defaults (string at point, last Isearch/replacement regexp/string) 1252regexp defaults (string at point, last Isearch/replacement regexp/string)
1252via M-n when reading a regexp in the minibuffer. 1253via 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
1255minibuffer-local-filename-must-match-map. 1257minibuffer-local-filename-must-match-map.
1256 1258
@@ -1259,6 +1261,7 @@ Since this means the returned list is not properly nil-terminated, this
1259is an incompatible change and is thus enabled by the new variable 1261is an incompatible change and is thus enabled by the new variable
1260completion-all-completions-with-base-size. 1262completion-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