changeset 81708:d71be1e37321

(PC-do-complete-and-exit): Add support for the new `confirm-only' confirmation mode.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 05 Jul 2007 19:42:43 +0000
parents cfd3797706aa
children 88604a3ac7e4
files lisp/ChangeLog lisp/complete.el
diffstat 2 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Jul 05 18:37:29 2007 +0000
+++ b/lisp/ChangeLog	Thu Jul 05 19:42:43 2007 +0000
@@ -1,3 +1,8 @@
+2007-07-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* complete.el (PC-do-complete-and-exit): Add support for the new
+	`confirm-only' confirmation mode.
+
 2007-07-05  Chong Yidong  <cyd@stupidchicken.com>
 
 	* cus-edit.el (custom-commands): New variable.
--- a/lisp/complete.el	Thu Jul 05 18:37:29 2007 +0000
+++ b/lisp/complete.el	Thu Jul 05 19:42:43 2007 +0000
@@ -328,14 +328,24 @@
     (PC-do-complete-and-exit)))
 
 (defun PC-do-complete-and-exit ()
-  (if (= (point-max) (minibuffer-prompt-end))  ; Duplicate the "bug" that Info-menu relies on...
-      (exit-minibuffer)
+  (cond
+   ((= (point-max) (minibuffer-prompt-end))
+    ;; Duplicate the "bug" that Info-menu relies on...
+    (exit-minibuffer))
+   ((eq minibuffer-completion-confirm 'confirm-only)
+    (if (or (eq last-command this-command)
+            (test-completion (field-string)
+                             minibuffer-completion-table
+                             minibuffer-completion-predicate))
+        (exit-minibuffer)
+      (PC-temp-minibuffer-message " [Confirm]")))
+   (t
     (let ((flag (PC-do-completion 'exit)))
       (and flag
 	   (if (or (eq flag 'complete)
 		   (not minibuffer-completion-confirm))
 	       (exit-minibuffer)
-	     (PC-temp-minibuffer-message " [Confirm]"))))))
+	     (PC-temp-minibuffer-message " [Confirm]")))))))
 
 
 (defun PC-completion-help ()