;;;###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.
(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