summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2020-05-30 19:57:06 +0300
committerDmitry Gutov <dgutov@yandex.ru>2020-05-30 19:57:38 +0300
commit780f674a82a90c4e3e32583059b498bfa57e4a06 (patch)
tree64c105b1d3a88748368fc42baa916f0357d7c7af
parent3dbe6530b124436550dae4db6cd4b7b380e95377 (diff)
downloademacs-780f674a82a90c4e3e32583059b498bfa57e4a06.tar.gz
Don't return transient projects with MAYBE-PROMPT=nil
* 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).
-rw-r--r--lisp/progmodes/project.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 1f2a4e84718..2d0b6c4a21b 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -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)