diff options
-rw-r--r-- | lisp/progmodes/project.el | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index c5b6209d9b4..ad0bb6763ac 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -824,12 +824,12 @@ It's also possible to enter an arbitrary directory." ;;;###autoload (defvar project-switch-commands - '(("f" "Find file" project-find-file) - ("r" "Find regexp" project-find-regexp) - ("d" "Dired" project-dired) - ("v" "VC-Dir" project-vc-dir) - ("s" "Shell" project-shell) - ("e" "Eshell" project-eshell)) + '((?f "Find file" project-find-file) + (?r "Find regexp" project-find-regexp) + (?d "Dired" project-dired) + (?v "VC-Dir" project-vc-dir) + (?s "Shell" project-shell) + (?e "Eshell" project-eshell)) "Alist mapping keys to project switching menu entries. Used by `project-switch-project' to construct a dispatch menu of commands available upon \"switching\" to another project. @@ -856,16 +856,12 @@ and presented in a dispatch menu." (interactive) (let ((dir (project-prompt-project-dir)) (choice nil)) - (while (not (and choice - (or (equal choice (kbd "C-g")) - (assoc choice project-switch-commands)))) - (setq choice (read-key-sequence (project--keymap-prompt)))) - (if (equal choice (kbd "C-g")) - (message "Quit") - (let ((default-directory dir) - (project-current-inhibit-prompt t)) - (call-interactively - (nth 2 (assoc choice project-switch-commands))))))) + (while (not choice) + (setq choice (assq (read-event (project--keymap-prompt)) + project-switch-commands))) + (let ((default-directory dir) + (project-current-inhibit-prompt t)) + (call-interactively (nth 2 choice))))) (provide 'project) ;;; project.el ends here |