diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2016-01-30 11:55:19 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2016-01-30 11:58:17 +0300 |
commit | a089d6a211c9051e27a78d03d5b323300134bb21 (patch) | |
tree | 2c1c5b6eecfd6cd562b6d13f73ab3c06ff71e8ea /lisp/progmodes | |
parent | ef760b899ad89f941f552ed2d3ac9e45156f3e3c (diff) | |
download | emacs-a089d6a211c9051e27a78d03d5b323300134bb21.tar.gz |
Don't fiddle with DEFAULT
* lisp/progmodes/project.el (project--completing-read-strict):
Don't change DEFAULT, whether is has any matches in
COLLECTION, or not.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/project.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0b05de29089..1251bca2491 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -374,9 +374,10 @@ recognized." (defun project--completing-read-strict (prompt collection &optional predicate hist default inherit-input-method) - (when (and default (not (test-completion default collection predicate))) - (setq default (car (completion-try-completion - default collection predicate (length default))))) + ;; Tried both expanding the default before showing the prompt, and + ;; removing it when it has no matches. Neither seems natural + ;; enough. Removal is confusing; early expansion makes the prompt + ;; too long. (let* ((new-prompt (if default (format "%s (default %s): " prompt default) (format "%s: " prompt))) |