From: Eli Zaretskii Date: Fri, 10 Jun 2022 11:22:18 +0000 (+0300) Subject: ; Fix documentation of 'completing-read' and friends X-Git-Tag: emacs-29.0.90~1910^2~96 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dc09759c1d1e7d7c6118fd8e582aaa57454cf001;p=emacs.git ; Fix documentation of 'completing-read' and friends * src/minibuf.c (Fcompleting_read): * lisp/minibuffer.el (read-file-name): * doc/lispref/minibuf.texi (Minibuffer Completion): * etc/NEWS: Fix typos and wording of the description of the REQUIRE-MATCH argument to 'completing-read'. --- diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 86e601f8c0f..1451e59d05c 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1122,9 +1122,9 @@ completion command (i.e., one of the commands in not an element of @var{collection}. @xref{Completion Commands}. @item -If a function, the function is called with the input as the only -argument. The function should return a non-@code{nil} value of the -input is acceptable. +If a function, it is called with the input as the only argument. The +function should return a non-@code{nil} value if the input is +acceptable. @item Any other value of @var{require-match} behaves like @code{t}, except diff --git a/etc/NEWS b/etc/NEWS index e19d08d51fc..88758abc64e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1952,7 +1952,7 @@ Previously it produced a nonsense value, -1, that was never intended. * Lisp Changes in Emacs 29.1 +++ -** 'completing-read' now allows a function as REQUIRE-MATCH. +** 'completing-read' now allows a function as its REQUIRE-MATCH argument. This function is called to see whether what the user has typed in is a match. This is also available from functions that call 'completing-read', like 'read-file-name'. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 332e3fcce97..bf89874ecc8 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3161,8 +3161,8 @@ Fourth arg MUSTMATCH can take the following values: input, but she needs to confirm her choice if she called `minibuffer-complete' right before `minibuffer-complete-and-exit' and the input is not an existing file. -- a function, which will be called with the input as the parameter. - If it returns a non-nil value, we exit with that value. +- a function, which will be called with the input as the argument. + If it returns a non-nil value, the minibuffer is exited with that value. - anything else behaves like t except that typing RET does not exit if it does non-null completion. diff --git a/src/minibuf.c b/src/minibuf.c index 3e984d163d1..2cfc2caa7f6 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2010,7 +2010,7 @@ REQUIRE-MATCH can take the following values: `minibuffer-complete' right before `minibuffer-complete-and-exit' and the input is not an element of COLLECTION. - a function, which will be called with the input as the parameter. - If it returns a non-nil value, we exit with that value. + If it returns a non-nil value, the minibuffer is exited with that value. - anything else behaves like t except that typing RET does not exit if it does non-null completion.