]> git.eshelyaron.com Git - emacs.git/commitdiff
(PC-do-complete-and-exit): Synch to 2008-11-24 change to
authorChong Yidong <cyd@stupidchicken.com>
Fri, 28 Nov 2008 19:11:58 +0000 (19:11 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 28 Nov 2008 19:11:58 +0000 (19:11 +0000)
minibuffer.el; recognize `confirm' and `confirm-after-completion'
values for minibuffer-completion-confirm.

lisp/complete.el

index 6626b7b959eb05b0dfd684aceb63386d43aafb90..f60763e425017bd77630b753f1b8e21044742b50 100644 (file)
@@ -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