diff options
author | Joseph Turner <joseph@breatheoutbreathe.in> | 2023-11-12 13:21:50 -0800 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-01-28 14:18:48 -0500 |
commit | 77f5d4d523a406650036b7cd0d872d39a114a9ac (patch) | |
tree | 01408abc110e2b9592a599bb11f3efdcfdd31c9f /lisp/minibuffer.el | |
parent | c22d0ae2dd899ebc1f74e4e67f098216899ea202 (diff) | |
download | emacs-77f5d4d523a406650036b7cd0d872d39a114a9ac.tar.gz emacs-77f5d4d523a406650036b7cd0d872d39a114a9ac.tar.bz2 emacs-77f5d4d523a406650036b7cd0d872d39a114a9ac.zip |
Fix completing-read functional REQUIRE-MATCH behavior
* lisp/minibuffer.el (completion--complete-and-exit): If
minibuffer-completion-confirm is a function which returns nil,
immediately fail to complete.
See bug#66187.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r-- | lisp/minibuffer.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3c4315b87fc..faa7f543ece 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1847,10 +1847,13 @@ appear to be a match." ;; Allow user to specify null string ((= beg end) (funcall exit-function)) ;; The CONFIRM argument is a predicate. - ((and (functionp minibuffer-completion-confirm) - (funcall minibuffer-completion-confirm - (buffer-substring beg end))) - (funcall exit-function)) + ((functionp minibuffer-completion-confirm) + (if (funcall minibuffer-completion-confirm + (buffer-substring beg end)) + (funcall exit-function) + (unless completion-fail-discreetly + (ding) + (completion--message "No match")))) ;; See if we have a completion from the table. ((test-completion (buffer-substring beg end) minibuffer-completion-table |