]> git.eshelyaron.com Git - emacs.git/commitdiff
Add and use minibuffer-confirm-exit-commands variable
authorMiles Bader <miles@gnu.org>
Sat, 29 Nov 2008 18:07:15 +0000 (18:07 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 29 Nov 2008 18:07:15 +0000 (18:07 +0000)
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1483

lisp/ChangeLog
lisp/minibuffer.el

index e87c543b3a32d838c841eb7fde851163f19e4e65..40d8cda4d2fa33efe66c7138533ed8b10aeadab7 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-29  Miles Bader  <miles@gnu.org>
+
+       * minibuffer.el (minibuffer-confirm-exit-commands): New variable.
+       (minibuffer-complete-and-exit): Use it.
+
 2008-11-29  Chong Yidong  <cyd@stupidchicken.com>
 
        * term/x-win.el (x-gtk-stock-cache): New hash table.
index 84d8e658a729e5fbd7069c2f549e813c4e8020a9..aab35a2814bf6a7219a8f74b00533cfb63860e39 100644 (file)
@@ -542,6 +542,11 @@ Repeated uses step through the possible completions."
       ;; through the previous possible completions.
       (setq completion-all-sorted-completions (cdr all)))))
 
+(defvar minibuffer-confirm-exit-commands
+  '(minibuffer-complete minibuffer-complete-word)
+  "A list of commands which cause an immediately following
+`minibuffer-complete-and-exit' to ask for extra confirmation.")
+
 (defun minibuffer-complete-and-exit ()
   "Exit if the minibuffer contains a valid completion.
 Otherwise, try to complete the minibuffer contents.  If
@@ -595,7 +600,7 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
      ((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 (eq last-command 'minibuffer-complete)
+      (if (memq last-command minibuffer-confirm-exit-commands)
          (progn (minibuffer-message "Confirm")
                 nil)
        (exit-minibuffer)))