]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve project name completion
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 12 May 2020 00:32:05 +0000 (03:32 +0300)
committerSimen Heggestøyl <simenheg@gmail.com>
Tue, 26 May 2020 15:41:24 +0000 (17:41 +0200)
* 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

index fd691be5599728f2ba3cb66e5f1aab12e98b12b4..3e943ca0533bd61623a411d86a00a4d864bcd08a 100644 (file)
@@ -763,8 +763,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)))