Commit 88893215 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(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.
parent 53d4c024
2008-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
* 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 <tassilo@member.fsf.org> 2008-04-14 Tassilo Horn <tassilo@member.fsf.org>
   
* doc-view.el (doc-view-dvipdf-program): New variable. * doc-view.el (doc-view-dvipdf-program): New variable.
...@@ -7,8 +14,8 @@ ...@@ -7,8 +14,8 @@
(doc-view-dvi->pdf): Prefer dvipdf over dvipdfm. (doc-view-dvi->pdf): Prefer dvipdf over dvipdfm.
   
* doc-view.el (doc-view-start-process): Don't set * doc-view.el (doc-view-start-process): Don't set
default-directory to "~/" if the current value is valid. This default-directory to "~/" if the current value is valid.
broke PS files that run other files in the same directory. This broke PS files that run other files in the same directory.
   
2008-04-14 Dan Nicolaescu <dann@ics.uci.edu> 2008-04-14 Dan Nicolaescu <dann@ics.uci.edu>
   
......
...@@ -131,14 +131,19 @@ You should give VAR a non-nil `risky-local-variable' property." ...@@ -131,14 +131,19 @@ You should give VAR a non-nil `risky-local-variable' property."
(defun completion-table-with-terminator (terminator table string pred action) (defun completion-table-with-terminator (terminator table string pred action)
(let ((comp (complete-with-action action table string pred))) (let ((comp (complete-with-action action table string pred)))
(if (eq action nil) (cond
(if (eq comp t) ((eq action nil)
(concat string terminator) (if (eq comp t)
(if (and (stringp comp) (concat string terminator)
(eq (complete-with-action action table comp pred) t)) (if (and (stringp comp)
(concat comp terminator) (eq (complete-with-action action table comp pred) t))
comp)) (concat comp terminator)
comp))) 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) (defun completion-table-in-turn (&rest tables)
"Create a completion table that tries each table in TABLES in turn." "Create a completion table that tries each table in TABLES in turn."
...@@ -707,8 +712,11 @@ during running `completion-setup-hook'." ...@@ -707,8 +712,11 @@ during running `completion-setup-hook'."
(if (funcall pred tem) (push tem comp)))) (if (funcall pred tem) (push tem comp))))
(setq all (nreverse comp)))) (setq all (nreverse comp))))
;; Add base-size, but only if the list is non-empty. (if (and completion-all-completions-with-base-size (consp all))
(if (consp all) (nconc all base-size)))) ;; Add base-size, but only if the list is non-empty.
(nconc all base-size))
all))
(t (t
;; Only other case actually used is ACTION = lambda. ;; Only other case actually used is ACTION = lambda.
...@@ -717,7 +725,7 @@ during running `completion-setup-hook'." ...@@ -717,7 +725,7 @@ during running `completion-setup-hook'."
(defalias 'read-file-name-internal (defalias 'read-file-name-internal
(completion-table-in-turn 'completion--embedded-envvar-table (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.") "Internal subroutine for `read-file-name'. Do not call this.")
(provide 'minibuffer) (provide 'minibuffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment