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