emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp minibuffer.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp minibuffer.el
Date: Mon, 24 Nov 2008 19:14:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/11/24 19:14:05

Modified files:
        lisp           : minibuffer.el 

Log message:
        (minibuffer-complete-and-exit): Change `confirm-only' value of
        minibuffer-completion-confirm to `confirm', and handle a
        `confirm-after-completion' value.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/minibuffer.el?cvsroot=emacs&r1=1.60&r2=1.61

Patches:
Index: minibuffer.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/minibuffer.el,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- minibuffer.el       29 Oct 2008 21:30:44 -0000      1.60
+++ minibuffer.el       24 Nov 2008 19:14:05 -0000      1.61
@@ -543,12 +543,18 @@
       (setq completion-all-sorted-completions (cdr all)))))
 
 (defun minibuffer-complete-and-exit ()
-  "If the minibuffer contents is a valid completion then exit.
-Otherwise try to complete it.  If completion leads to a valid completion,
-a repetition of this command will exit.
-If `minibuffer-completion-confirm' is equal to `confirm', then do not
-try to complete, but simply ask for confirmation and accept any
-input if confirmed."
+  "Exit if the minibuffer contains a valid completion.
+Otherwise, try to complete the minibuffer contents.  If
+completion leads to a valid completion, a repetition of this
+command will exit.
+
+If `minibuffer-completion-confirm' is `confirm', do not try to
+ complete; instead, ask for confirmation and accept any input if
+ confirmed.
+If `minibuffer-completion-confirm' is `confirm-after-completion',
+ do not try to complete; instead, ask for confirmation if the
+ preceding minibuffer command was `minibuffer-complete', and
+ accept the input otherwise."
   (interactive)
   (let ((beg (field-beginning))
         (end (field-end)))
@@ -578,14 +584,22 @@
             (delete-region beg end))))
       (exit-minibuffer))
 
-     ((eq minibuffer-completion-confirm 'confirm-only)
+     ((eq minibuffer-completion-confirm 'confirm)
       ;; The user is permitted to exit with an input that's rejected
-      ;; by test-completion, but at the condition to confirm her choice.
+      ;; by test-completion, after confirming her choice.
       (if (eq last-command this-command)
           (exit-minibuffer)
         (minibuffer-message "Confirm")
         nil))
 
+     ((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)
+         (progn (minibuffer-message "Confirm")
+                nil)
+       (exit-minibuffer)))
+
      (t
       ;; Call do-completion, but ignore errors.
       (case (condition-case nil




reply via email to

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