aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2025-03-15 01:01:16 +0100
committerStefan Kangas2025-03-15 04:10:27 +0100
commitecd756dd391c1436820593e240f1f7b8a28b2c6e (patch)
treebf5f038505af9a05ade2bd3fbdfabc698bc91fe3
parent679ad95a67fbecafd203c9e7f55547a312b3833b (diff)
downloademacs-ecd756dd391c1436820593e240f1f7b8a28b2c6e.tar.gz
emacs-ecd756dd391c1436820593e240f1f7b8a28b2c6e.zip
Recommend using 'keymap-set' in Commentaries
* lisp/calendar/timeclock.el, lisp/comint.el, lisp/ehelp.el: * lisp/gnus/gnus-bookmark.el, lisp/gnus/smiley.el, lisp/ido.el: * lisp/isearchb.el, lisp/mail/mailabbrev.el, lisp/net/ange-ftp.el: * lisp/net/goto-addr.el, lisp/play/fortune.el, lisp/saveplace.el: * lisp/shell.el, lisp/term.el, lisp/textmodes/makeinfo.el: * lisp/textmodes/refer.el, lisp/textmodes/remember.el: * lisp/textmodes/table.el, lisp/woman.el: Recommend using 'keymap-set' instead of 'define-key' in Commentaries.
-rw-r--r--lisp/calendar/timeclock.el12
-rw-r--r--lisp/comint.el4
-rw-r--r--lisp/ehelp.el6
-rw-r--r--lisp/gnus/gnus-bookmark.el8
-rw-r--r--lisp/gnus/smiley.el9
-rw-r--r--lisp/ido.el2
-rw-r--r--lisp/isearchb.el2
-rw-r--r--lisp/mail/mailabbrev.el4
-rw-r--r--lisp/net/ange-ftp.el6
-rw-r--r--lisp/net/goto-addr.el5
-rw-r--r--lisp/play/fortune.el5
-rw-r--r--lisp/saveplace.el2
-rw-r--r--lisp/shell.el4
-rw-r--r--lisp/term.el4
-rw-r--r--lisp/textmodes/makeinfo.el8
-rw-r--r--lisp/textmodes/refer.el2
-rw-r--r--lisp/textmodes/remember.el2
-rw-r--r--lisp/textmodes/table.el2
-rw-r--r--lisp/woman.el5
19 files changed, 43 insertions, 49 deletions
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 5fa3ec333d4..5d32e37695f 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -37,12 +37,12 @@
37;; You'll probably want to bind the timeclock commands to some handy 37;; You'll probably want to bind the timeclock commands to some handy
38;; keystrokes. Assuming C-c t is unbound, you might use: 38;; keystrokes. Assuming C-c t is unbound, you might use:
39;; 39;;
40;; (define-key (kbd "C-c t i") 'timeclock-in) 40;; (keymap-set "C-c t i" 'timeclock-in)
41;; (define-key (kbd "C-c t o") 'timeclock-out) 41;; (keymap-set "C-c t o" 'timeclock-out)
42;; (define-key (kbd "C-c t c") 'timeclock-change) 42;; (keymap-set "C-c t c" 'timeclock-change)
43;; (define-key (kbd "C-c t r") 'timeclock-reread-log) 43;; (keymap-set "C-c t r" 'timeclock-reread-log)
44;; (define-key (kbd "C-c t u") 'timeclock-update-mode-line) 44;; (keymap-set "C-c t u" 'timeclock-update-mode-line)
45;; (define-key (kbd "C-c t w") 'timeclock-when-to-leave-string) 45;; (keymap-set "C-c t w" 'timeclock-when-to-leave-string)
46 46
47;; If you want Emacs to display the amount of time "left" to your 47;; If you want Emacs to display the amount of time "left" to your
48;; workday in the mode-line, you can either set the value of 48;; workday in the mode-line, you can either set the value of
diff --git a/lisp/comint.el b/lisp/comint.el
index f0305e4de3c..f92ee382473 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3215,8 +3215,8 @@ its response can be seen."
3215 3215
3216;; These are not installed in the comint-mode keymap. But they are 3216;; These are not installed in the comint-mode keymap. But they are
3217;; available for people who want them. Shell-mode installs them: 3217;; available for people who want them. Shell-mode installs them:
3218;; (define-key shell-mode-map "\t" 'completion-at-point) 3218;; (keymap-set shell-mode-map "TAB" 'completion-at-point)
3219;; (define-key shell-mode-map "\M-?" 3219;; (keymap-set shell-mode-map "M-?"
3220;; 'comint-dynamic-list-filename-completions))) 3220;; 'comint-dynamic-list-filename-completions)))
3221;; 3221;;
3222;; Commands like this are fine things to put in load hooks if you 3222;; Commands like this are fine things to put in load hooks if you
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index 42212f69196..ed86f663100 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -31,9 +31,9 @@
31;; buffer. 31;; buffer.
32 32
33;; To make this the default, you must do 33;; To make this the default, you must do
34;; (define-key global-map "\C-h" 'ehelp-command) 34;; (keymap-global-set "C-h" 'ehelp-command)
35;; (define-key global-map [help] 'ehelp-command) 35;; (keymap-global-set "<help>" 'ehelp-command)
36;; (define-key global-map [f1] 'ehelp-command) 36;; (keymap-global-set "<f1>" 'ehelp-command)
37 37
38;;; Code: 38;;; Code:
39 39
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el
index dbe587491ff..6c07e15fa49 100644
--- a/lisp/gnus/gnus-bookmark.el
+++ b/lisp/gnus/gnus-bookmark.el
@@ -55,10 +55,10 @@
55(require 'gnus-sum) 55(require 'gnus-sum)
56 56
57;; FIXME: should avoid using C-c (no?) 57;; FIXME: should avoid using C-c (no?)
58;; (define-key gnus-summary-mode-map "\C-crm" 'gnus-bookmark-set) 58;; (keymap-set gnus-summary-mode-map "C-c r m" 'gnus-bookmark-set)
59;; (define-key global-map "\C-crb" 'gnus-bookmark-jump) 59;; (keymap-global-set "C-c r b" 'gnus-bookmark-jump)
60;; (define-key global-map "\C-crj" 'gnus-bookmark-jump) 60;; (keymap-global-set "C-c r j" 'gnus-bookmark-jump)
61;; (define-key global-map "\C-crl" 'gnus-bookmark-bmenu-list) 61;; (keymap-global-set "C-c r l" 'gnus-bookmark-bmenu-list)
62 62
63;; FIXME: Add keybindings, see 63;; FIXME: Add keybindings, see
64;; http://thread.gmane.org/gmane.emacs.gnus.general/63101/focus=63379 [dead link] 64;; http://thread.gmane.org/gmane.emacs.gnus.general/63101/focus=63379 [dead link]
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el
index c8cbde28de6..8b023cd1dbb 100644
--- a/lisp/gnus/smiley.el
+++ b/lisp/gnus/smiley.el
@@ -189,12 +189,9 @@ regexp to replace with IMAGE. IMAGE is the name of an image file in
189 smiley-cached-regexp-alist)))))))) 189 smiley-cached-regexp-alist))))))))
190 190
191;; Not implemented: 191;; Not implemented:
192;; (defvar smiley-mouse-map 192;; (defvar-keymap smiley-mouse-map
193;; (let ((map (make-sparse-keymap))) 193;; "<down-mouse-2>" #'ignore ; override widget
194;; (define-key map [down-mouse-2] 'ignore) ; override widget 194;; "<mouse-2>" #'smiley-mouse-toggle-buffer)
195;; (define-key map [mouse-2]
196;; 'smiley-mouse-toggle-buffer)
197;; map))
198 195
199;;;###autoload 196;;;###autoload
200(defun smiley-region (start end) 197(defun smiley-region (start end)
diff --git a/lisp/ido.el b/lisp/ido.el
index 8987fa471de..cd1f9260262 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -214,7 +214,7 @@
214;; `ido-buffer-completion-map'. 214;; `ido-buffer-completion-map'.
215;; 215;;
216;; (with-eval-after-load 'ido 216;; (with-eval-after-load 'ido
217;; (define-key ido-common-completion-map " " 'ido-next-match)) 217;; (keymap-set ido-common-completion-map "SPC" 'ido-next-match))
218 218
219;; Seeing all the matching buffers or files 219;; Seeing all the matching buffers or files
220;; ---------------------------------------- 220;; ----------------------------------------
diff --git a/lisp/isearchb.el b/lisp/isearchb.el
index 599f7976044..9ecd83a2b6a 100644
--- a/lisp/isearchb.el
+++ b/lisp/isearchb.el
@@ -41,7 +41,7 @@
41;; mode, just like with isearch. I use C-z for this. The binding in 41;; mode, just like with isearch. I use C-z for this. The binding in
42;; my .emacs looks like: 42;; my .emacs looks like:
43;; 43;;
44;; (define-key global-map [(control ?z)] 'isearchb-activate) 44;; (keymap-global-set "C-z" 'isearchb-activate)
45;; 45;;
46;; Now, after pressing C-z (for example), each self-inserting 46;; Now, after pressing C-z (for example), each self-inserting
47;; character thereafter will search for a buffer containing those 47;; character thereafter will search for a buffer containing those
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 15d697db6f9..534f277ac57 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -109,8 +109,8 @@
109;; (add-hook 109;; (add-hook
110;; 'mail-mode-hook 110;; 'mail-mode-hook
111;; (lambda () 111;; (lambda ()
112;; (define-key mail-mode-map [remap next-line] 'mail-abbrev-next-line) 112;; (keymap-set mail-mode-map "<remap> <next-line>" 'mail-abbrev-next-line)
113;; (define-key mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer))) 113;; (keymap-set mail-mode-map "<remap> <end-of-buffer>" 'mail-abbrev-end-of-buffer)))
114;; 114;;
115;; If you want multiple addresses separated by a string other than ", " then 115;; If you want multiple addresses separated by a string other than ", " then
116;; you can set the variable mail-alias-separator-string to it. This has to 116;; you can set the variable mail-alias-separator-string to it. This has to
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index db889bfec68..84e170987ef 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1460,7 +1460,7 @@ only return the directory part of FILE."
1460;;;; ------------------------------------------------------------ 1460;;;; ------------------------------------------------------------
1461 1461
1462;; (setq ange-ftp-tmp-keymap (make-sparse-keymap)) 1462;; (setq ange-ftp-tmp-keymap (make-sparse-keymap))
1463;; (define-key ange-ftp-tmp-keymap "\C-m" 'exit-minibuffer) 1463;; (keymap-set ange-ftp-tmp-keymap "C-m" 'exit-minibuffer)
1464 1464
1465(defun ange-ftp-repaint-minibuffer () 1465(defun ange-ftp-repaint-minibuffer ()
1466 "Clear any existing minibuffer message; let the minibuffer contents show." 1466 "Clear any existing minibuffer message; let the minibuffer contents show."
@@ -4101,8 +4101,8 @@ E.g.,
4101;; Put these lines uncommented in your .emacs if you want C-r to refresh 4101;; Put these lines uncommented in your .emacs if you want C-r to refresh
4102;; ange-ftp's cache whilst doing filename completion. 4102;; ange-ftp's cache whilst doing filename completion.
4103;; 4103;;
4104;;(define-key minibuffer-local-completion-map "\C-r" 'ange-ftp-reread-dir) 4104;;(keymap-set minibuffer-local-completion-map "C-r" 'ange-ftp-reread-dir)
4105;;(define-key minibuffer-local-must-match-map "\C-r" 'ange-ftp-reread-dir) 4105;;(keymap-set minibuffer-local-must-match-map "C-r" 'ange-ftp-reread-dir)
4106 4106
4107;;;###autoload 4107;;;###autoload
4108(define-obsolete-function-alias 'ange-ftp-re-read-dir #'ange-ftp-reread-dir "29.1") 4108(define-obsolete-function-alias 'ange-ftp-re-read-dir #'ange-ftp-reread-dir "29.1")
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index ad273663523..d803a050e90 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -43,9 +43,8 @@
43;; (for example): 43;; (for example):
44;; 44;;
45;; (setq goto-address-highlight-keymap 45;; (setq goto-address-highlight-keymap
46;; (let ((m (make-sparse-keymap))) 46;; (define-keymap
47;; (define-key m [S-mouse-2] 'goto-address-at-point) 47;; "S-<mouse-2>" 'goto-address-at-point))
48;; m))
49;; 48;;
50 49
51;; Known bugs/features: 50;; Known bugs/features:
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el
index 0fa98f486be..f917b3f701a 100644
--- a/lisp/play/fortune.el
+++ b/lisp/play/fortune.el
@@ -57,9 +57,8 @@
57;; 57;;
58;; I also have this in my .gnus: 58;; I also have this in my .gnus:
59;; 59;;
60;; (add-hook 'gnus-article-mode-hook 60;; (with-eval-after-load 'gnus-art
61;; (lambda () 61;; (keymap-set gnus-article-mode-map "i" #'fortune-from-region))
62;; (define-key gnus-article-mode-map "i" #'fortune-from-region)))
63;; 62;;
64;; which allows marking a region and then pressing "i" so that the marked 63;; which allows marking a region and then pressing "i" so that the marked
65;; region will be automatically added to my favorite fortune file. 64;; region will be automatically added to my favorite fortune file.
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index 65dbcf41be2..8b8d9a445d7 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -38,7 +38,7 @@
38(require 'cl-lib) 38(require 'cl-lib)
39 39
40;; this is what I was using during testing: 40;; this is what I was using during testing:
41;; (define-key ctl-x-map "p" 'toggle-save-place-globally) 41;; (keymap-set ctl-x-map "p" 'toggle-save-place-globally)
42 42
43(defgroup save-place nil 43(defgroup save-place nil
44 "Automatically save place in files." 44 "Automatically save place in files."
diff --git a/lisp/shell.el b/lisp/shell.el
index 54a404f1ee2..a35a0840651 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -48,8 +48,8 @@
48;; Some suggestions for your init file. 48;; Some suggestions for your init file.
49;; 49;;
50;; ;; Define M-# to run some strange command: 50;; ;; Define M-# to run some strange command:
51;; (eval-after-load "shell" 51;; (with-eval-after-load 'shell
52;; '(define-key shell-mode-map "\M-#" 'shells-dynamic-spell)) 52;; (keymap-set shell-mode-map "M-#" 'shells-dynamic-spell))
53 53
54;; Brief Command Documentation: 54;; Brief Command Documentation:
55;;============================================================================ 55;;============================================================================
diff --git a/lisp/term.el b/lisp/term.el
index 8d57f949615..4f0c5337c1e 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -4228,8 +4228,8 @@ This is a good place to put keybindings.")
4228 4228
4229;; These are not installed in the term-mode keymap. But they are 4229;; These are not installed in the term-mode keymap. But they are
4230;; available for people who want them. Shell-mode installs them: 4230;; available for people who want them. Shell-mode installs them:
4231;; (define-key shell-mode-map "\t" 'term-dynamic-complete) 4231;; (keymap-set shell-mode-map "TAB" 'term-dynamic-complete)
4232;; (define-key shell-mode-map "\M-?" 4232;; (keymap-set shell-mode-map "M-?"
4233;; 'term-dynamic-list-filename-completions))) 4233;; 'term-dynamic-list-filename-completions)))
4234;; 4234;;
4235;; Commands like this are fine things to put in load hooks if you 4235;; Commands like this are fine things to put in load hooks if you
diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el
index b2d58b41bfa..9c1d0c5223a 100644
--- a/lisp/textmodes/makeinfo.el
+++ b/lisp/textmodes/makeinfo.el
@@ -34,10 +34,10 @@
34;;; Keybindings (defined in `texinfo.el') 34;;; Keybindings (defined in `texinfo.el')
35 35
36;; makeinfo bindings 36;; makeinfo bindings
37; (define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region) 37; (keymap-set texinfo-mode-map "C-c C-m C-r" 'makeinfo-region)
38; (define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer) 38; (keymap-set texinfo-mode-map "C-c C-m C-b" 'makeinfo-buffer)
39; (define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation) 39; (keymap-set texinfo-mode-map "C-c C-m C-k" 'kill-compilation)
40; (define-key texinfo-mode-map "\C-c\C-m\C-l" 40; (keymap-set texinfo-mode-map "C-c C-m C-l"
41; 'makeinfo-recenter-compilation-buffer) 41; 'makeinfo-recenter-compilation-buffer)
42 42
43;;; Code: 43;;; Code:
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 0e38c2e0969..c7569ea8f35 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -46,7 +46,7 @@
46;; refer-yank-key to insert it at point in the current buffer 46;; refer-yank-key to insert it at point in the current buffer
47;; (typically as the argument of a \cite{} command). 47;; (typically as the argument of a \cite{} command).
48;; 48;;
49;; I use (define-key tex-mode-map "\C-c\C-y" 'refer-yank-key) 49;; I use (keymap-set tex-mode-map "C-c C-y" 'refer-yank-key)
50;; to bind this often-used function to a key in (la)tex-mode. 50;; to bind this often-used function to a key in (la)tex-mode.
51;; 51;;
52;; If the list of bibliography files changes, reinitialize the variable 52;; If the list of bibliography files changes, reinitialize the variable
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index ac0dd384dda..d04d811d78f 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -129,7 +129,7 @@
129;; To map the primary remember function to the keystroke F8, do the 129;; To map the primary remember function to the keystroke F8, do the
130;; following. 130;; following.
131;; 131;;
132;; (define-key global-map [f8] 'remember) 132;; (keymap-global-set "<f8>" 'remember)
133;; 133;;
134;; * Feedback 134;; * Feedback
135;; 135;;
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index e8f4170e729..0e024f9261e 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -343,7 +343,7 @@
343;; 343;;
344;; (add-hook 'table-cell-map-hook 344;; (add-hook 'table-cell-map-hook
345;; (lambda () 345;; (lambda ()
346;; (define-key table-cell-map [<key sequence>] '<function>))) 346;; (keymap-set table-cell-map "<key sequence>" '<function>)))
347;; 347;;
348;; ----- 348;; -----
349;; Menu: 349;; Menu:
diff --git a/lisp/woman.el b/lisp/woman.el
index 0d740fd071e..67f2b5cf9d7 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -89,9 +89,8 @@
89;; structure. 89;; structure.
90 90
91;; Or (3): Put this in your init file: 91;; Or (3): Put this in your init file:
92;; (add-hook 'dired-mode-hook 92;; (with-eval-after-load 'dired
93;; (lambda () 93;; (keymap-set dired-mode-map "W" 'woman-dired-find-file))
94;; (define-key dired-mode-map "W" 'woman-dired-find-file)))
95;; and open the directory containing the man page file using Dired, 94;; and open the directory containing the man page file using Dired,
96;; put the cursor on the file, and press `W'. 95;; put the cursor on the file, and press `W'.
97 96