aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-01-12 21:00:19 +0200
committerEli Zaretskii2016-01-12 21:00:19 +0200
commite879070d8c329e4e7ccbd6687ef577589faedcf1 (patch)
treeeda0bd46fb1871b89aa6ad4d5a0b11389654fdd1
parent792d469d698966e99435d60b4c2136302a171ded (diff)
downloademacs-e879070d8c329e4e7ccbd6687ef577589faedcf1.tar.gz
emacs-e879070d8c329e4e7ccbd6687ef577589faedcf1.zip
Document changes in 'read-buffer' and 'read-buffer-function'
* doc/lispref/minibuf.texi (High-Level Completion): Document the 4th argument to 'read-buffer' and 'read-buffer-function'.
-rw-r--r--doc/lispref/minibuf.texi22
-rw-r--r--etc/NEWS4
2 files changed, 17 insertions, 9 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index bf9564627d6..ead4fe982dc 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1236,14 +1236,14 @@ Lisp function. When possible, do all minibuffer input as part of
1236reading the arguments for a command, in the @code{interactive} 1236reading the arguments for a command, in the @code{interactive}
1237specification. @xref{Defining Commands}. 1237specification. @xref{Defining Commands}.
1238 1238
1239@defun read-buffer prompt &optional default require-match 1239@defun read-buffer prompt &optional default require-match predicate
1240This function reads the name of a buffer and returns it as a string. 1240This function reads the name of a buffer and returns it as a string.
1241The argument @var{default} is the default name to use, the value to 1241It prompts with @var{prompt}. The argument @var{default} is the
1242return if the user exits with an empty minibuffer. If non-@code{nil}, 1242default name to use, the value to return if the user exits with an
1243it should be a string, a list of strings, or a buffer. If it is 1243empty minibuffer. If non-@code{nil}, it should be a string, a list of
1244a list, the default value is the first element of this list. It is 1244strings, or a buffer. If it is a list, the default value is the first
1245mentioned in the prompt, but is not inserted in the minibuffer as 1245element of this list. It is mentioned in the prompt, but is not
1246initial input. 1246inserted in the minibuffer as initial input.
1247 1247
1248The argument @var{prompt} should be a string ending with a colon and a 1248The argument @var{prompt} should be a string ending with a colon and a
1249space. If @var{default} is non-@code{nil}, the function inserts it in 1249space. If @var{default} is non-@code{nil}, the function inserts it in
@@ -1253,6 +1253,12 @@ the minibuffer with a default value (@pxref{Programming Tips}).
1253The optional argument @var{require-match} has the same meaning as in 1253The optional argument @var{require-match} has the same meaning as in
1254@code{completing-read}. @xref{Minibuffer Completion}. 1254@code{completing-read}. @xref{Minibuffer Completion}.
1255 1255
1256The optional argument @var{predicate}, if non-@code{nil}, specifies a
1257function to filter the buffers that should be considered: the function
1258will be called with every potential candidate as its argument, and
1259should return @code{nil} to reject the candidate, non-@code{nil} to
1260accept it.
1261
1256In the following example, the user enters @samp{minibuffer.t}, and 1262In the following example, the user enters @samp{minibuffer.t}, and
1257then types @key{RET}. The argument @var{require-match} is @code{t}, 1263then types @key{RET}. The argument @var{require-match} is @code{t},
1258and the only buffer name starting with the given input is 1264and the only buffer name starting with the given input is
@@ -1287,7 +1293,7 @@ its usual work, with the same arguments passed to @code{read-buffer}.
1287 1293
1288@defopt read-buffer-completion-ignore-case 1294@defopt read-buffer-completion-ignore-case
1289If this variable is non-@code{nil}, @code{read-buffer} ignores case 1295If this variable is non-@code{nil}, @code{read-buffer} ignores case
1290when performing completion. 1296when performing completion while reading the buffer name.
1291@end defopt 1297@end defopt
1292 1298
1293@defun read-command prompt &optional default 1299@defun read-command prompt &optional default
diff --git a/etc/NEWS b/etc/NEWS
index 9c416ae7070..029e9d8392f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1221,7 +1221,9 @@ Use the INSIDE_EMACS environment variable instead.
1221** `save-excursion' does not save&restore the mark any more. 1221** `save-excursion' does not save&restore the mark any more.
1222Use `save-mark-and-excursion' if you want the old behavior. 1222Use `save-mark-and-excursion' if you want the old behavior.
1223 1223
1224** read-buffer-function can now be called with a 4th argument (`predicate'). 1224+++
1225** `read-buffer' and `read-buffer-function' can now be called with a 4th
1226argument (`predicate').
1225 1227
1226** completion-table-dynamic stays in the minibuffer. 1228** completion-table-dynamic stays in the minibuffer.
1227If you want the old behavior of calling the function in the buffer 1229If you want the old behavior of calling the function in the buffer