]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't return transient projects with MAYBE-PROMPT=nil
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 30 May 2020 16:57:06 +0000 (19:57 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 30 May 2020 16:57:38 +0000 (19:57 +0300)
* lisp/progmodes/project.el (project-current): Only return
transient projects when called with non-nil MAYBE-PROMPT.
Also only update the known projects lists in this case.
(https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg03375.html).

lisp/progmodes/project.el

index 1f2a4e84718d2aa7674524fc36529ea8fb35282e..2d0b6c4a21b86edde8cfab563945f254725d5621 100644 (file)
@@ -115,10 +115,11 @@ the user for a different project to look in."
         maybe-prompt)
       (setq dir (project-prompt-project-dir)
             pr (project--find-in-directory dir))))
-    (if pr
-        (project--add-to-project-list-front pr)
-      (project--remove-from-project-list dir)
-      (setq pr (cons 'transient dir)))
+    (when maybe-prompt
+      (if pr
+          (project--add-to-project-list-front pr)
+        (project--remove-from-project-list dir)
+        (setq pr (cons 'transient dir))))
     pr))
 
 (defun project--find-in-directory (dir)