From f8d106b0f806da2527a702ef80e16be1f6636fea Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Nov 2008 19:11:58 +0000 Subject: [PATCH] (PC-do-complete-and-exit): Synch to 2008-11-24 change to minibuffer.el; recognize `confirm' and `confirm-after-completion' values for minibuffer-completion-confirm. --- lisp/complete.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/complete.el b/lisp/complete.el index 6626b7b959e..f60763e4250 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -330,13 +330,22 @@ See `PC-complete' for details." ((= (point-max) (minibuffer-prompt-end)) ;; Duplicate the "bug" that Info-menu relies on... (exit-minibuffer)) - ((eq minibuffer-completion-confirm 'confirm-only) + ((eq minibuffer-completion-confirm 'confirm) (if (or (eq last-command this-command) (test-completion (field-string) minibuffer-completion-table minibuffer-completion-predicate)) (exit-minibuffer) (PC-temp-minibuffer-message " [Confirm]"))) + ((eq minibuffer-completion-confirm 'confirm-after-completion) + ;; Similar to the above, but only if trying to exit immediately + ;; after typing TAB (this catches most minibuffer typos). + (if (and (memq last-command '(PC-complete minibuffer-complete)) + (not (test-completion (field-string) + minibuffer-completion-table + minibuffer-completion-predicate))) + (PC-temp-minibuffer-message " [Confirm]") + (exit-minibuffer))) (t (let ((flag (PC-do-completion 'exit))) (and flag -- 2.39.2