all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jiacai Liu <hello@liujiacai.net>
To: emacs-devel@gnu.org
Subject: project.el switch project improvements
Date: Sat, 04 Sep 2021 22:11:54 +0800	[thread overview]
Message-ID: <14322.2473141336$1630765207@news.gmane.org> (raw)

[-- 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))))

             reply	other threads:[~2021-09-04 14:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 14:11 Jiacai Liu [this message]
     [not found] <m1ilzgfn1k.fsf@liujiacai.net>
2021-09-04 18:49 ` project.el switch project improvements 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='14322.2473141336$1630765207@news.gmane.org' \
    --to=hello@liujiacai.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.