aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/project.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 956a4b8a345..132d172a08e 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -101,6 +101,9 @@ Each functions on this hook is called in turn with one
101argument (the directory) and should return either nil to mean 101argument (the directory) and should return either nil to mean
102that it is not applicable, or a project instance.") 102that it is not applicable, or a project instance.")
103 103
104(defvar project-current-inhibit-prompt nil
105 "Non-nil to skip prompting the user in `project-current'.")
106
104;;;###autoload 107;;;###autoload
105(defun project-current (&optional maybe-prompt dir) 108(defun project-current (&optional maybe-prompt dir)
106 "Return the project instance in DIR or `default-directory'. 109 "Return the project instance in DIR or `default-directory'.
@@ -110,7 +113,8 @@ the user for a different project to look in."
110 (let ((pr (project--find-in-directory dir))) 113 (let ((pr (project--find-in-directory dir)))
111 (cond 114 (cond
112 (pr) 115 (pr)
113 (maybe-prompt 116 ((unless project-current-inhibit-prompt
117 maybe-prompt)
114 (setq dir (project-prompt-project-dir) 118 (setq dir (project-prompt-project-dir)
115 pr (project--find-in-directory dir)))) 119 pr (project--find-in-directory dir))))
116 (if pr 120 (if pr
@@ -829,7 +833,8 @@ and presented in a dispatch menu."
829 (setq choice (read-key-sequence (project--keymap-prompt)))) 833 (setq choice (read-key-sequence (project--keymap-prompt))))
830 (if (equal choice (kbd "C-g")) 834 (if (equal choice (kbd "C-g"))
831 (message "Quit") 835 (message "Quit")
832 (let ((default-directory dir)) 836 (let ((default-directory dir)
837 (project-current-inhibit-prompt t))
833 (call-interactively 838 (call-interactively
834 (nth 2 (assoc choice project-switch-commands))))))) 839 (nth 2 (assoc choice project-switch-commands)))))))
835 840