From a089d6a211c9051e27a78d03d5b323300134bb21 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 30 Jan 2016 11:55:19 +0300 Subject: [PATCH] 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. --- lisp/progmodes/project.el | 7 ++++--- 1 file 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))) -- 2.39.5