all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* project.el switch project improvements
@ 2021-09-04 14:11 Jiacai Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Jiacai Liu @ 2021-09-04 14:11 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]


Hi,

project-switch-project command in master will prompt a list of 
commands after choose
one project, it would be nice to just call it directly when length 
of project-switch-commands is 1.

Any idea about this change?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: project.patch --]
[-- Type: text/x-patch, Size: 701 bytes --]

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index e420a4ccca..52289d3ccc 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1409,7 +1409,9 @@ project-switch-project
               (when-let ((cmd (nth 0 row))
                          (keychar (nth 2 row)))
                 (define-key temp-map (vector keychar) cmd)))))
-         command)
+         (command (when (= 1 (length commands-menu))
+                    ;; pick first command when only have one choice
+                    (caar commands-menu))))
     (while (not command)
       (let* ((overriding-local-map commands-map)
              (choice (read-key-sequence (project--keymap-prompt))))

^ permalink raw reply related	[flat|nested] 5+ messages in thread
[parent not found: <m1ilzgfn1k.fsf@liujiacai.net>]

end of thread, other threads:[~2021-09-07 15:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-04 14:11 project.el switch project improvements Jiacai Liu
     [not found] <m1ilzgfn1k.fsf@liujiacai.net>
2021-09-04 18:49 ` Dmitry Gutov
2021-09-05  3:46   ` Jiacai Liu
     [not found]   ` <m11r63smzb.fsf@liujiacai.net>
2021-09-07  1:47     ` Dmitry Gutov
2021-09-07 15:24       ` Jiacai Liu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.