Mercurial > emacs
comparison lisp/complete.el @ 100016:92d948bc8621
(PC-do-complete-and-exit): Synch to 2008-11-24 change to
minibuffer.el; recognize `confirm' and `confirm-after-completion'
values for minibuffer-completion-confirm.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 28 Nov 2008 19:11:58 +0000 |
parents | cf3a44c40410 |
children | 172ab771edf9 |
comparison
equal
deleted
inserted
replaced
100015:57fc0e782532 | 100016:92d948bc8621 |
---|---|
328 (defun PC-do-complete-and-exit () | 328 (defun PC-do-complete-and-exit () |
329 (cond | 329 (cond |
330 ((= (point-max) (minibuffer-prompt-end)) | 330 ((= (point-max) (minibuffer-prompt-end)) |
331 ;; Duplicate the "bug" that Info-menu relies on... | 331 ;; Duplicate the "bug" that Info-menu relies on... |
332 (exit-minibuffer)) | 332 (exit-minibuffer)) |
333 ((eq minibuffer-completion-confirm 'confirm-only) | 333 ((eq minibuffer-completion-confirm 'confirm) |
334 (if (or (eq last-command this-command) | 334 (if (or (eq last-command this-command) |
335 (test-completion (field-string) | 335 (test-completion (field-string) |
336 minibuffer-completion-table | 336 minibuffer-completion-table |
337 minibuffer-completion-predicate)) | 337 minibuffer-completion-predicate)) |
338 (exit-minibuffer) | 338 (exit-minibuffer) |
339 (PC-temp-minibuffer-message " [Confirm]"))) | 339 (PC-temp-minibuffer-message " [Confirm]"))) |
340 ((eq minibuffer-completion-confirm 'confirm-after-completion) | |
341 ;; Similar to the above, but only if trying to exit immediately | |
342 ;; after typing TAB (this catches most minibuffer typos). | |
343 (if (and (memq last-command '(PC-complete minibuffer-complete)) | |
344 (not (test-completion (field-string) | |
345 minibuffer-completion-table | |
346 minibuffer-completion-predicate))) | |
347 (PC-temp-minibuffer-message " [Confirm]") | |
348 (exit-minibuffer))) | |
340 (t | 349 (t |
341 (let ((flag (PC-do-completion 'exit))) | 350 (let ((flag (PC-do-completion 'exit))) |
342 (and flag | 351 (and flag |
343 (if (or (eq flag 'complete) | 352 (if (or (eq flag 'complete) |
344 (not minibuffer-completion-confirm)) | 353 (not minibuffer-completion-confirm)) |