diff options
| author | Miles Bader | 2008-11-29 18:07:15 +0000 |
|---|---|---|
| committer | Miles Bader | 2008-11-29 18:07:15 +0000 |
| commit | d182658510e5c8b91c49cb755aee4d94e5cb89f9 (patch) | |
| tree | 39e444b61ebf8fd658fb6e1ac91c02615f37abc5 | |
| parent | 98d059989aafb4ff00a7479b4cc37a1034ce72d7 (diff) | |
| download | emacs-d182658510e5c8b91c49cb755aee4d94e5cb89f9.tar.gz emacs-d182658510e5c8b91c49cb755aee4d94e5cb89f9.zip | |
Add and use minibuffer-confirm-exit-commands variable
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1483
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 7 |
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 @@ | |||
| 1 | 2008-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 | |||
| 1 | 2008-11-29 Chong Yidong <cyd@stupidchicken.com> | 6 | 2008-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. |
| 547 | Otherwise, try to complete the minibuffer contents. If | 552 | Otherwise, 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))) |