(icomplete--completion-table)
(icomplete--completion-predicate)
(if (window-minibuffer-p)
- (not minibuffer-completion-confirm)))))
+ (eq minibuffer--require-match t)))))
(buffer-undo-list t)
deactivate-mark)
;; Do nothing if while-no-input was aborted.
(minibuffer-prompt-end) (point-max) #'exit-minibuffer
;; If the previous completion completed to an element which fails
;; test-completion, then we shouldn't exit, but that should be rare.
- (lambda () (minibuffer-message "Incomplete"))))
+ (lambda ()
+ (if minibuffer--require-match
+ (minibuffer-message "Incomplete")
+ ;; If a match is not required, exit after all.
+ (exit-minibuffer)))))
(defun minibuffer-force-complete (&optional start end dont-cycle)
"Complete the minibuffer to an exact match.
"List of commands which cause an immediately following
`minibuffer-complete-and-exit' to ask for extra confirmation.")
+(defvar minibuffer--require-match nil
+ "Value of REQUIRE-MATCH passed to `completing-read'.")
+
(defun minibuffer-complete-and-exit ()
"Exit if the minibuffer contains a valid completion.
Otherwise, try to complete the minibuffer contents. If
(let* ((minibuffer-completion-table collection)
(minibuffer-completion-predicate predicate)
+ ;; FIXME: Remove/rename this var, see the next one.
(minibuffer-completion-confirm (unless (eq require-match t)
require-match))
+ (minibuffer--require-match require-match)
(base-keymap (if require-match
minibuffer-local-must-match-map
minibuffer-local-completion-map))