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

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

bug#45134: Add project-switch-project-by-name


From: Dmitry Gutov
Subject: bug#45134: Add project-switch-project-by-name
Date: Wed, 9 Dec 2020 21:36:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 09.12.2020 17:14, Rudolf Schlatte wrote:
Certain “dashboard-type” packages present a list of projects and let the
user switch to one of them.  In that case, the project root is already
known, and project.el only needs to present the dispatch menu of
‘project-switch-commands’.

So the idea is you know the directory in advance and only need to show the dispatch menu?

How about this instead?

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 449eadc3de..f7c6a55f44 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1275,13 +1275,13 @@ project--keymap-prompt
    "  "))

 ;;;###autoload
-(defun project-switch-project ()
+(defun project-switch-project (dir)
   "\"Switch\" to another project by running an Emacs command.
 The available commands are presented as a dispatch menu
 made from `project-switch-commands'."
-  (interactive)
-  (let ((dir (project-prompt-project-dir))
-        (choice nil))
+  (interactive
+   (list (project-prompt-project-dir)))
+  (let ((choice nil))
     (while (not choice)
       (setq choice (assq (read-event (project--keymap-prompt))
                          project-switch-commands)))






reply via email to

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