emacs-devel
[Top][All Lists]
Advanced

[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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]