# HG changeset patch # User Stefan Monnier # Date 1208185836 0 # Node ID 28e2f73174d6aa5f9b7e9d60933c202e0d4d08a9 # Parent b359dad87c7e3cfcdf405bd8eef5c77b320ee05a (completion-table-with-terminator): Those completions are never valid w.r.t test-completion. (completion--file-name-table): Check completion-all-completions-with-base-size. diff -r b359dad87c7e -r 28e2f73174d6 lisp/ChangeLog --- a/lisp/ChangeLog Mon Apr 14 13:18:12 2008 +0000 +++ b/lisp/ChangeLog Mon Apr 14 15:10:36 2008 +0000 @@ -1,3 +1,10 @@ +2008-04-14 Stefan Monnier + + * minibuffer.el (completion-table-with-terminator): Those completions + are never valid w.r.t test-completion. + (completion--file-name-table): + Check completion-all-completions-with-base-size. + 2008-04-14 Tassilo Horn * doc-view.el (doc-view-dvipdf-program): New variable. @@ -7,8 +14,8 @@ (doc-view-dvi->pdf): Prefer dvipdf over dvipdfm. * doc-view.el (doc-view-start-process): Don't set - default-directory to "~/" if the current value is valid. This - broke PS files that run other files in the same directory. + default-directory to "~/" if the current value is valid. + This broke PS files that run other files in the same directory. 2008-04-14 Dan Nicolaescu diff -r b359dad87c7e -r 28e2f73174d6 lisp/minibuffer.el --- a/lisp/minibuffer.el Mon Apr 14 13:18:12 2008 +0000 +++ b/lisp/minibuffer.el Mon Apr 14 15:10:36 2008 +0000 @@ -131,14 +131,19 @@ (defun completion-table-with-terminator (terminator table string pred action) (let ((comp (complete-with-action action table string pred))) - (if (eq action nil) - (if (eq comp t) - (concat string terminator) - (if (and (stringp comp) - (eq (complete-with-action action table comp pred) t)) - (concat comp terminator) - comp)) - comp))) + (cond + ((eq action nil) + (if (eq comp t) + (concat string terminator) + (if (and (stringp comp) + (eq (complete-with-action action table comp pred) t)) + (concat comp terminator) + comp)) + comp) + ;; completion-table-with-terminator is always used for + ;; "sub-completions" so it's only called if the terminator is missing, + ;; in which case `test-completion' should return nil. + ((eq action 'lambda) nil)))) (defun completion-table-in-turn (&rest tables) "Create a completion table that tries each table in TABLES in turn." @@ -707,8 +712,11 @@ (if (funcall pred tem) (push tem comp)))) (setq all (nreverse comp)))) - ;; Add base-size, but only if the list is non-empty. - (if (consp all) (nconc all base-size)))) + (if (and completion-all-completions-with-base-size (consp all)) + ;; Add base-size, but only if the list is non-empty. + (nconc all base-size)) + + all)) (t ;; Only other case actually used is ACTION = lambda. @@ -717,7 +725,7 @@ (defalias 'read-file-name-internal (completion-table-in-turn 'completion--embedded-envvar-table - 'completion--file-name-table) + 'completion--file-name-table) "Internal subroutine for `read-file-name'. Do not call this.") (provide 'minibuffer)