diff options
| author | Stefan Monnier | 2008-04-14 15:10:36 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-04-14 15:10:36 +0000 |
| commit | 888932153ba7b6984deef265e72d624ef9faaa92 (patch) | |
| tree | 9f04f1492ca9d88bd58269606f4bab46d7c9bce0 | |
| parent | 53d4c024e9407cfc884005f9c969f7488bc3ec99 (diff) | |
| download | emacs-888932153ba7b6984deef265e72d624ef9faaa92.tar.gz emacs-888932153ba7b6984deef265e72d624ef9faaa92.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 30 |
2 files changed, 28 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ceec5796399..90090c66784 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-04-14 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuffer.el (completion-table-with-terminator): Those completions | ||
| 4 | are never valid w.r.t test-completion. | ||
| 5 | (completion--file-name-table): | ||
| 6 | Check completion-all-completions-with-base-size. | ||
| 7 | |||
| 1 | 2008-04-14 Tassilo Horn <tassilo@member.fsf.org> | 8 | 2008-04-14 Tassilo Horn <tassilo@member.fsf.org> |
| 2 | 9 | ||
| 3 | * doc-view.el (doc-view-dvipdf-program): New variable. | 10 | * doc-view.el (doc-view-dvipdf-program): New variable. |
| @@ -7,8 +14,8 @@ | |||
| 7 | (doc-view-dvi->pdf): Prefer dvipdf over dvipdfm. | 14 | (doc-view-dvi->pdf): Prefer dvipdf over dvipdfm. |
| 8 | 15 | ||
| 9 | * doc-view.el (doc-view-start-process): Don't set | 16 | * doc-view.el (doc-view-start-process): Don't set |
| 10 | default-directory to "~/" if the current value is valid. This | 17 | default-directory to "~/" if the current value is valid. |
| 11 | broke PS files that run other files in the same directory. | 18 | This broke PS files that run other files in the same directory. |
| 12 | 19 | ||
| 13 | 2008-04-14 Dan Nicolaescu <dann@ics.uci.edu> | 20 | 2008-04-14 Dan Nicolaescu <dann@ics.uci.edu> |
| 14 | 21 | ||
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 7baef47ba79..7429af3248d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -131,14 +131,19 @@ You should give VAR a non-nil `risky-local-variable' property." | |||
| 131 | 131 | ||
| 132 | (defun completion-table-with-terminator (terminator table string pred action) | 132 | (defun completion-table-with-terminator (terminator table string pred action) |
| 133 | (let ((comp (complete-with-action action table string pred))) | 133 | (let ((comp (complete-with-action action table string pred))) |
| 134 | (if (eq action nil) | 134 | (cond |
| 135 | (if (eq comp t) | 135 | ((eq action nil) |
| 136 | (concat string terminator) | 136 | (if (eq comp t) |
| 137 | (if (and (stringp comp) | 137 | (concat string terminator) |
| 138 | (eq (complete-with-action action table comp pred) t)) | 138 | (if (and (stringp comp) |
| 139 | (concat comp terminator) | 139 | (eq (complete-with-action action table comp pred) t)) |
| 140 | comp)) | 140 | (concat comp terminator) |
| 141 | comp))) | 141 | comp)) |
| 142 | comp) | ||
| 143 | ;; completion-table-with-terminator is always used for | ||
| 144 | ;; "sub-completions" so it's only called if the terminator is missing, | ||
| 145 | ;; in which case `test-completion' should return nil. | ||
| 146 | ((eq action 'lambda) nil)))) | ||
| 142 | 147 | ||
| 143 | (defun completion-table-in-turn (&rest tables) | 148 | (defun completion-table-in-turn (&rest tables) |
| 144 | "Create a completion table that tries each table in TABLES in turn." | 149 | "Create a completion table that tries each table in TABLES in turn." |
| @@ -707,8 +712,11 @@ during running `completion-setup-hook'." | |||
| 707 | (if (funcall pred tem) (push tem comp)))) | 712 | (if (funcall pred tem) (push tem comp)))) |
| 708 | (setq all (nreverse comp)))) | 713 | (setq all (nreverse comp)))) |
| 709 | 714 | ||
| 710 | ;; Add base-size, but only if the list is non-empty. | 715 | (if (and completion-all-completions-with-base-size (consp all)) |
| 711 | (if (consp all) (nconc all base-size)))) | 716 | ;; Add base-size, but only if the list is non-empty. |
| 717 | (nconc all base-size)) | ||
| 718 | |||
| 719 | all)) | ||
| 712 | 720 | ||
| 713 | (t | 721 | (t |
| 714 | ;; Only other case actually used is ACTION = lambda. | 722 | ;; Only other case actually used is ACTION = lambda. |
| @@ -717,7 +725,7 @@ during running `completion-setup-hook'." | |||
| 717 | 725 | ||
| 718 | (defalias 'read-file-name-internal | 726 | (defalias 'read-file-name-internal |
| 719 | (completion-table-in-turn 'completion--embedded-envvar-table | 727 | (completion-table-in-turn 'completion--embedded-envvar-table |
| 720 | 'completion--file-name-table) | 728 | 'completion--file-name-table) |
| 721 | "Internal subroutine for `read-file-name'. Do not call this.") | 729 | "Internal subroutine for `read-file-name'. Do not call this.") |
| 722 | 730 | ||
| 723 | (provide 'minibuffer) | 731 | (provide 'minibuffer) |