# HG changeset patch # User Stefan Monnier # Date 1183664563 0 # Node ID d71be1e373219d36ab71995036d2e9c890a2eed2 # Parent cfd3797706aa3ca8fb61be615f8e227669b9b618 (PC-do-complete-and-exit): Add support for the new `confirm-only' confirmation mode. diff -r cfd3797706aa -r d71be1e37321 lisp/ChangeLog --- 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 + + * complete.el (PC-do-complete-and-exit): Add support for the new + `confirm-only' confirmation mode. + 2007-07-05 Chong Yidong * cus-edit.el (custom-commands): New variable. diff -r cfd3797706aa -r d71be1e37321 lisp/complete.el --- 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 ()