diff options
| author | Stefan Kangas | 2022-10-29 07:44:07 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-10-29 08:21:59 +0200 |
| commit | ce527464440ca070e752ca18a68ebf2d369a14df (patch) | |
| tree | e39c1053bb1b8a766a8039045a70904668c21415 | |
| parent | 3b0296c8b03436c7848009ca0238b1126dc3bac7 (diff) | |
| download | emacs-ce527464440ca070e752ca18a68ebf2d369a14df.tar.gz emacs-ce527464440ca070e752ca18a68ebf2d369a14df.zip | |
Prefer defvar-keymap in help.el
* lisp/help.el (help-key): New function.
(help-map): Prefer defvar-keymap.
| -rw-r--r-- | lisp/help.el | 122 |
1 files changed, 62 insertions, 60 deletions
diff --git a/lisp/help.el b/lisp/help.el index d48b866938d..b25a8ce2995 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -55,66 +55,68 @@ | |||
| 55 | This variable is bound to t during the preparation of a *Help* | 55 | This variable is bound to t during the preparation of a *Help* |
| 56 | buffer.") | 56 | buffer.") |
| 57 | 57 | ||
| 58 | (defvar help-map | 58 | (defun help-key () |
| 59 | (let ((map (make-sparse-keymap))) | 59 | "Return `help-char' in a format suitable for the `keymap-set' KEY argument." |
| 60 | (define-key map (char-to-string help-char) 'help-for-help) | 60 | (key-description (char-to-string help-char))) |
| 61 | (define-key map [help] 'help-for-help) | 61 | |
| 62 | (define-key map [f1] 'help-for-help) | 62 | (defvar-keymap help-map |
| 63 | (define-key map "." 'display-local-help) | 63 | :doc "Keymap for characters following the Help key." |
| 64 | (define-key map "?" 'help-for-help) | 64 | (help-key) #'help-for-help |
| 65 | 65 | "<help>" #'help-for-help | |
| 66 | (define-key map "\C-a" 'about-emacs) | 66 | "<f1>" #'help-for-help |
| 67 | (define-key map "\C-c" 'describe-copying) | 67 | "." #'display-local-help |
| 68 | (define-key map "\C-d" 'view-emacs-debugging) | 68 | "?" #'help-for-help |
| 69 | (define-key map "\C-e" 'view-external-packages) | 69 | |
| 70 | (define-key map "\C-f" 'view-emacs-FAQ) | 70 | "C-a" #'about-emacs |
| 71 | (define-key map "\C-m" 'view-order-manuals) | 71 | "C-c" #'describe-copying |
| 72 | (define-key map "\C-n" 'view-emacs-news) | 72 | "C-d" #'view-emacs-debugging |
| 73 | (define-key map "\C-o" 'describe-distribution) | 73 | "C-e" #'view-external-packages |
| 74 | (define-key map "\C-p" 'view-emacs-problems) | 74 | "C-f" #'view-emacs-FAQ |
| 75 | (define-key map "\C-s" 'search-forward-help-for-help) | 75 | "RET" #'view-order-manuals |
| 76 | (define-key map "\C-t" 'view-emacs-todo) | 76 | "C-n" #'view-emacs-news |
| 77 | (define-key map "\C-w" 'describe-no-warranty) | 77 | "C-o" #'describe-distribution |
| 78 | 78 | "C-p" #'view-emacs-problems | |
| 79 | ;; This does not fit the pattern, but it is natural given the C-\ command. | 79 | "C-s" #'search-forward-help-for-help |
| 80 | (define-key map "\C-\\" 'describe-input-method) | 80 | "C-t" #'view-emacs-todo |
| 81 | 81 | "C-w" #'describe-no-warranty | |
| 82 | (define-key map "C" 'describe-coding-system) | 82 | |
| 83 | (define-key map "F" 'Info-goto-emacs-command-node) | 83 | ;; This does not fit the pattern, but it is natural given the C-\ command. |
| 84 | (define-key map "I" 'describe-input-method) | 84 | "C-\\" #'describe-input-method |
| 85 | (define-key map "K" 'Info-goto-emacs-key-command-node) | 85 | |
| 86 | (define-key map "L" 'describe-language-environment) | 86 | "C" #'describe-coding-system |
| 87 | (define-key map "S" 'info-lookup-symbol) | 87 | "F" #'Info-goto-emacs-command-node |
| 88 | 88 | "I" #'describe-input-method | |
| 89 | (define-key map "a" 'apropos-command) | 89 | "K" #'Info-goto-emacs-key-command-node |
| 90 | (define-key map "b" 'describe-bindings) | 90 | "L" #'describe-language-environment |
| 91 | (define-key map "c" 'describe-key-briefly) | 91 | "S" #'info-lookup-symbol |
| 92 | (define-key map "d" 'apropos-documentation) | 92 | |
| 93 | (define-key map "e" 'view-echo-area-messages) | 93 | "a" #'apropos-command |
| 94 | (define-key map "f" 'describe-function) | 94 | "b" #'describe-bindings |
| 95 | (define-key map "g" 'describe-gnu-project) | 95 | "c" #'describe-key-briefly |
| 96 | (define-key map "h" 'view-hello-file) | 96 | "d" #'apropos-documentation |
| 97 | 97 | "e" #'view-echo-area-messages | |
| 98 | (define-key map "i" 'info) | 98 | "f" #'describe-function |
| 99 | (define-key map "4i" 'info-other-window) | 99 | "g" #'describe-gnu-project |
| 100 | 100 | "h" #'view-hello-file | |
| 101 | (define-key map "k" 'describe-key) | 101 | |
| 102 | (define-key map "l" 'view-lossage) | 102 | "i" #'info |
| 103 | (define-key map "m" 'describe-mode) | 103 | "4 i" #'info-other-window |
| 104 | (define-key map "o" 'describe-symbol) | 104 | |
| 105 | (define-key map "n" 'view-emacs-news) | 105 | "k" #'describe-key |
| 106 | (define-key map "p" 'finder-by-keyword) | 106 | "l" #'view-lossage |
| 107 | (define-key map "P" 'describe-package) | 107 | "m" #'describe-mode |
| 108 | (define-key map "r" 'info-emacs-manual) | 108 | "o" #'describe-symbol |
| 109 | (define-key map "R" 'info-display-manual) | 109 | "n" #'view-emacs-news |
| 110 | (define-key map "s" 'describe-syntax) | 110 | "p" #'finder-by-keyword |
| 111 | (define-key map "t" 'help-with-tutorial) | 111 | "P" #'describe-package |
| 112 | (define-key map "v" 'describe-variable) | 112 | "r" #'info-emacs-manual |
| 113 | (define-key map "w" 'where-is) | 113 | "R" #'info-display-manual |
| 114 | (define-key map "x" 'describe-command) | 114 | "s" #'describe-syntax |
| 115 | (define-key map "q" 'help-quit-or-quick) | 115 | "t" #'help-with-tutorial |
| 116 | map) | 116 | "v" #'describe-variable |
| 117 | "Keymap for characters following the Help key.") | 117 | "w" #'where-is |
| 118 | "x" #'describe-command | ||
| 119 | "q" #'help-quit-or-quick) | ||
| 118 | 120 | ||
| 119 | (define-key global-map (char-to-string help-char) 'help-command) | 121 | (define-key global-map (char-to-string help-char) 'help-command) |
| 120 | (define-key global-map [help] 'help-command) | 122 | (define-key global-map [help] 'help-command) |