]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't fiddle with DEFAULT
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 30 Jan 2016 08:55:19 +0000 (11:55 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 30 Jan 2016 08:58:17 +0000 (11:58 +0300)
* lisp/progmodes/project.el (project--completing-read-strict):
Don't change DEFAULT, whether is has any matches in
COLLECTION, or not.

lisp/progmodes/project.el

index 0b05de290892a8163306b9c70425fada7958f931..1251bca2491de4df3c8d65fcba47055902a772a3 100644 (file)
@@ -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)))