diff options
| author | Simen Heggestøyl | 2020-06-04 19:56:32 +0200 |
|---|---|---|
| committer | Simen Heggestøyl | 2020-06-04 20:14:02 +0200 |
| commit | e7fb0a48a65c986e75d39848cac3c4d2435f4baa (patch) | |
| tree | be20466dae3dc3c48cbc92fbf13324b3179c0643 | |
| parent | b41be0ee83bdcc7882b360b66105f192503f0dc7 (diff) | |
| download | emacs-e7fb0a48a65c986e75d39848cac3c4d2435f4baa.tar.gz emacs-e7fb0a48a65c986e75d39848cac3c4d2435f4baa.zip | |
Use characters for keys in project-switch-commands
* lisp/progmodes/project.el (project-switch-commands): Use
characters for keys instead of string for better future
compatibility with 'read-multiple-choice'.
(project-switch-project): Adjust to above change.
| -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." | |||
| 824 | 824 | ||
| 825 | ;;;###autoload | 825 | ;;;###autoload |
| 826 | (defvar project-switch-commands | 826 | (defvar project-switch-commands |
| 827 | '(("f" "Find file" project-find-file) | 827 | '((?f "Find file" project-find-file) |
| 828 | ("r" "Find regexp" project-find-regexp) | 828 | (?r "Find regexp" project-find-regexp) |
| 829 | ("d" "Dired" project-dired) | 829 | (?d "Dired" project-dired) |
| 830 | ("v" "VC-Dir" project-vc-dir) | 830 | (?v "VC-Dir" project-vc-dir) |
| 831 | ("s" "Shell" project-shell) | 831 | (?s "Shell" project-shell) |
| 832 | ("e" "Eshell" project-eshell)) | 832 | (?e "Eshell" project-eshell)) |
| 833 | "Alist mapping keys to project switching menu entries. | 833 | "Alist mapping keys to project switching menu entries. |
| 834 | Used by `project-switch-project' to construct a dispatch menu of | 834 | Used by `project-switch-project' to construct a dispatch menu of |
| 835 | commands available upon \"switching\" to another project. | 835 | commands available upon \"switching\" to another project. |
| @@ -856,16 +856,12 @@ and presented in a dispatch menu." | |||
| 856 | (interactive) | 856 | (interactive) |
| 857 | (let ((dir (project-prompt-project-dir)) | 857 | (let ((dir (project-prompt-project-dir)) |
| 858 | (choice nil)) | 858 | (choice nil)) |
| 859 | (while (not (and choice | 859 | (while (not choice) |
| 860 | (or (equal choice (kbd "C-g")) | 860 | (setq choice (assq (read-event (project--keymap-prompt)) |
| 861 | (assoc choice project-switch-commands)))) | 861 | project-switch-commands))) |
| 862 | (setq choice (read-key-sequence (project--keymap-prompt)))) | 862 | (let ((default-directory dir) |
| 863 | (if (equal choice (kbd "C-g")) | 863 | (project-current-inhibit-prompt t)) |
| 864 | (message "Quit") | 864 | (call-interactively (nth 2 choice))))) |
| 865 | (let ((default-directory dir) | ||
| 866 | (project-current-inhibit-prompt t)) | ||
| 867 | (call-interactively | ||
| 868 | (nth 2 (assoc choice project-switch-commands))))))) | ||
| 869 | 865 | ||
| 870 | (provide 'project) | 866 | (provide 'project) |
| 871 | ;;; project.el ends here | 867 | ;;; project.el ends here |