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.
This commit is contained in:
committed by
Stefan Monnier
parent
c22d0ae2dd
commit
77f5d4d523
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user