bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#67310: [PATCH] Include the project--list as history when prompting f


From: Dmitry Gutov
Subject: bug#67310: [PATCH] Include the project--list as history when prompting for a project
Date: Sun, 10 Dec 2023 05:04:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi Juri,

On 27/11/2023 19:10, Juri Linkov wrote:
+            ;; Iterate in reverse order so project--name-history is in
+            ;; the correct order.
+            (dolist (dir (reverse (project-known-project-roots)))
                ;; we filter out directories that no longer map to a project,
                ;; since they don't have a clean project-name.
-              (if-let (proj (project--find-in-directory dir))
-                  (push (cons (project-name proj) proj) ret)))
+              (when-let (proj (project--find-in-directory dir))
+                (let ((name (project-name proj)))
+                  (push name project--name-history)
+                  (push (cons name proj) ret))))
This change broke the order of 'C-x p p M-n M-n ...',
so I pushed this fix:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index f7f057396e1..a81bb63fba4 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1808,7 +1808,7 @@ project-prompt-project-name
                           (name (project-name proj)))
                  (push name project--name-history)
                  (push (cons name proj) ret)))
-            ret))
+            (reverse ret)))
           ;; XXX: Just using this for the category (for the substring
           ;; completion style).
           (table (project--file-completion-table

Could you remind me which behavior in 'M-n M-n' the aforementioned change relates to? Is this supposed to be like input history as well, or the contents of the completions table in a certain order?

I just tried find-file, and the future history is empty there, so I suppose this is something we added particularly for project-find-file.





reply via email to

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