aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/minibuffer.el7
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e87c543b3a3..40d8cda4d2f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-11-29 Miles Bader <miles@gnu.org>
2
3 * minibuffer.el (minibuffer-confirm-exit-commands): New variable.
4 (minibuffer-complete-and-exit): Use it.
5
12008-11-29 Chong Yidong <cyd@stupidchicken.com> 62008-11-29 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * term/x-win.el (x-gtk-stock-cache): New hash table. 8 * term/x-win.el (x-gtk-stock-cache): New hash table.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 84d8e658a72..aab35a2814b 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -542,6 +542,11 @@ Repeated uses step through the possible completions."
542 ;; through the previous possible completions. 542 ;; through the previous possible completions.
543 (setq completion-all-sorted-completions (cdr all))))) 543 (setq completion-all-sorted-completions (cdr all)))))
544 544
545(defvar minibuffer-confirm-exit-commands
546 '(minibuffer-complete minibuffer-complete-word)
547 "A list of commands which cause an immediately following
548`minibuffer-complete-and-exit' to ask for extra confirmation.")
549
545(defun minibuffer-complete-and-exit () 550(defun minibuffer-complete-and-exit ()
546 "Exit if the minibuffer contains a valid completion. 551 "Exit if the minibuffer contains a valid completion.
547Otherwise, try to complete the minibuffer contents. If 552Otherwise, try to complete the minibuffer contents. If
@@ -595,7 +600,7 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
595 ((eq minibuffer-completion-confirm 'confirm-after-completion) 600 ((eq minibuffer-completion-confirm 'confirm-after-completion)
596 ;; Similar to the above, but only if trying to exit immediately 601 ;; Similar to the above, but only if trying to exit immediately
597 ;; after typing TAB (this catches most minibuffer typos). 602 ;; after typing TAB (this catches most minibuffer typos).
598 (if (eq last-command 'minibuffer-complete) 603 (if (memq last-command minibuffer-confirm-exit-commands)
599 (progn (minibuffer-message "Confirm") 604 (progn (minibuffer-message "Confirm")
600 nil) 605 nil)
601 (exit-minibuffer))) 606 (exit-minibuffer)))