[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/project-switching 0b057ca 12/15: Teach project-current to inhibi
From: |
Simen Heggestøyl |
Subject: |
feature/project-switching 0b057ca 12/15: Teach project-current to inhibit the prompt |
Date: |
Tue, 26 May 2020 11:43:19 -0400 (EDT) |
branch: feature/project-switching
commit 0b057ca9bcfa2bbef57f7e5a1da47d62f4f1f15a
Author: Dmitry Gutov <address@hidden>
Commit: Simen Heggestøyl <address@hidden>
Teach project-current to inhibit the prompt
* lisp/progmodes/project.el:
(project-current-inhibit-prompt): New variable.
(project-current, project-switch-project): Use it.
---
lisp/progmodes/project.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 956a4b8..132d172 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
argument (the directory) and should return either nil to mean
that it is not applicable, or a project instance.")
+(defvar project-current-inhibit-prompt nil
+ "Non-nil to skip prompting the user in `project-current'.")
+
;;;###autoload
(defun project-current (&optional maybe-prompt dir)
"Return the project instance in DIR or `default-directory'.
@@ -110,7 +113,8 @@ the user for a different project to look in."
(let ((pr (project--find-in-directory dir)))
(cond
(pr)
- (maybe-prompt
+ ((unless project-current-inhibit-prompt
+ maybe-prompt)
(setq dir (project-prompt-project-dir)
pr (project--find-in-directory dir))))
(if pr
@@ -829,7 +833,8 @@ and presented in a dispatch menu."
(setq choice (read-key-sequence (project--keymap-prompt))))
(if (equal choice (kbd "C-g"))
(message "Quit")
- (let ((default-directory dir))
+ (let ((default-directory dir)
+ (project-current-inhibit-prompt t))
(call-interactively
(nth 2 (assoc choice project-switch-commands)))))))
- feature/project-switching 9422fb5 03/15: Improve project name completion, (continued)
- feature/project-switching 9422fb5 03/15: Improve project name completion, Simen Heggestøyl, 2020/05/26
- feature/project-switching c8cca68 04/15: Use an alist instead of a keymap, Simen Heggestøyl, 2020/05/26
- feature/project-switching afb96da 05/15: Move project-dired and project-eshell higher, Simen Heggestøyl, 2020/05/26
- feature/project-switching 02e1ee9 06/15: Integrate project-switch-project with project-find-regexp, Simen Heggestøyl, 2020/05/26
- feature/project-switching 46bb2cb 07/15: Change dispatch binding of 'project-find-regexp', Simen Heggestøyl, 2020/05/26
- feature/project-switching 0db801a 11/15: Update the Emacs manual with recent project.el changes, Simen Heggestøyl, 2020/05/26
- feature/project-switching e37e6c8 13/15: Some copy edits, Simen Heggestøyl, 2020/05/26
- feature/project-switching 9f88356 02/15: Simplify a little, and avoid duplicate commands, Simen Heggestøyl, 2020/05/26
- feature/project-switching c6f56bd 08/15: Turn project switch menu var into a public alist, Simen Heggestøyl, 2020/05/26
- feature/project-switching 7082468 10/15: Rename 'project-switch-menu' to 'project-switch-commands', Simen Heggestøyl, 2020/05/26
- feature/project-switching 0b057ca 12/15: Teach project-current to inhibit the prompt,
Simen Heggestøyl <=
- feature/project-switching 449810b 15/15: Avoid adding the empty string to the project list, Simen Heggestøyl, 2020/05/26
- feature/project-switching c6e80fd 09/15: Simplify 'project--keymap-prompt' a bit, Simen Heggestøyl, 2020/05/26
- feature/project-switching 5a48ede 14/15: Adapt project functions to the new 'project-root', Simen Heggestøyl, 2020/05/26