[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x C-b and C-x C-f bugging about confirmation
From: |
Miles Bader |
Subject: |
Re: C-x C-b and C-x C-f bugging about confirmation |
Date: |
Tue, 25 Nov 2008 13:03:54 +0900 |
Patch seems to work well.
I have a few of my own custom completion commands which I'd like to be
treated like`minibuffer-complete' for purposes of confirmation; any
objections to the following additional patch?
Thanks,
-Miles
2008-11-25 Miles Bader <address@hidden>
* minibuffer.el (minibuffer-confirm-exit-commands): New variable.
(minibuffer-complete-and-exit): Use it.
--- orig/lisp/minibuffer.el
+++ mod/lisp/minibuffer.el
@@ -542,6 +542,10 @@
;; through the previous possible completions.
(setq completion-all-sorted-completions (cdr all)))))
+(defvar minibuffer-confirm-exit-commands '(minibuffer-complete)
+ "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 +599,7 @@
((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)))
--
Learning, n. The kind of ignorance distinguishing the studious.
- Re: C-x C-b and C-x C-f bugging about confirmation, (continued)
- Re: C-x C-b and C-x C-f bugging about confirmation, Juri Linkov, 2008/11/23
- Re: C-x C-b and C-x C-f bugging about confirmation, Miles Bader, 2008/11/23
- Re: C-x C-b and C-x C-f bugging about confirmation, Juri Linkov, 2008/11/23
- Re: C-x C-b and C-x C-f bugging about confirmation, Chong Yidong, 2008/11/23
- Re: C-x C-b and C-x C-f bugging about confirmation, Stefan Monnier, 2008/11/23
- Re: C-x C-b and C-x C-f bugging about confirmation, Chong Yidong, 2008/11/24
- Re: C-x C-b and C-x C-f bugging about confirmation, Stefan Monnier, 2008/11/24
- Re: C-x C-b and C-x C-f bugging about confirmation, mail, 2008/11/24
- Re: C-x C-b and C-x C-f bugging about confirmation,
Miles Bader <=
- Re: C-x C-b and C-x C-f bugging about confirmation, Stefan Monnier, 2008/11/25
- Re: C-x C-b and C-x C-f bugging about confirmation, Eli Zaretskii, 2008/11/25
- Re: C-x C-b and C-x C-f bugging about confirmation, Alfred M\. Szmidt, 2008/11/24
- Re: C-x C-b and C-x C-f bugging about confirmation, Stefan Monnier, 2008/11/24
- Re: C-x C-b and C-x C-f bugging about confirmation, Alfred M\. Szmidt, 2008/11/24
- Re: C-x C-b and C-x C-f bugging about confirmation, Romain Francoise, 2008/11/28
- Re: C-x C-b and C-x C-f bugging about confirmation, Chong Yidong, 2008/11/28
- Re: C-x C-b and C-x C-f bugging about confirmation, Stefan Monnier, 2008/11/28
- partial-completion-mode (was: C-x C-b and C-x C-f bugging about confirmation), Romain Francoise, 2008/11/28
- Re: partial-completion-mode, Stefan Monnier, 2008/11/28