]> git.eshelyaron.com Git - emacs.git/commitdiff
Put './' in the project directory completions
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 22 Sep 2021 18:07:49 +0000 (21:07 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 22 Sep 2021 18:08:42 +0000 (21:08 +0300)
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Put './' in the completions set when cpd was in the original
(bug#50732).

lisp/progmodes/project.el

index ebd21d4b60257c553ee9949d57e6198ab43b67b5..2eead0d0696085dfb34d9bde696df13831617043 100644 (file)
@@ -887,7 +887,13 @@ by the user at will."
          (prompt (if (zerop cpd-length)
                      prompt
                    (concat prompt (format " in %s" common-parent-directory))))
+         (included-cpd (when (member common-parent-directory all-files)
+                         (setq all-files
+                               (delete common-parent-directory all-files))
+                         t))
          (substrings (mapcar (lambda (s) (substring s cpd-length)) all-files))
+         (_ (when included-cpd
+              (setq substrings (cons "./" substrings))))
          (new-collection (project--file-completion-table substrings))
          (res (project--completing-read-strict prompt
                                                new-collection