emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/project-switching-x 8d6b841 2/5: Improve project name completion


From: Dmitry Gutov
Subject: scratch/project-switching-x 8d6b841 2/5: Improve project name completion
Date: Mon, 11 May 2020 21:21:03 -0400 (EDT)

branch: scratch/project-switching-x
commit 8d6b84159cbc7380bb7c7670a7b911c3b826fbf5
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Improve project name completion
    
    * lisp/progmodes/project.el:
    (project-prompt-project-dir): Use REQUIRE-MATCH=t.  Make sure the
    'substring' completion style is used by default.
---
 lisp/progmodes/project.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 08eb774..b5e7414 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -698,8 +698,12 @@ The project is chosen among projects known from the 
project list.
 It's also possible to enter an arbitrary directory."
   (project--ensure-read-project-list)
   (let* ((dir-choice "... (choose a dir)")
-         (choices (append project--list `(,dir-choice)))
-         (pr-dir (completing-read "Project: " choices)))
+         (choices
+          ;; XXX: Just using this for the category (for the substring
+          ;; completion style).
+          (project--file-completion-table
+           (append project--list `(,dir-choice))))
+         (pr-dir (completing-read "Project: " choices nil t)))
     (if (equal pr-dir dir-choice)
         (read-directory-name "Choose directory: " default-directory nil t)
       pr-dir)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]