]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer command remapping to substitute-key-definition
authorStefan Kangas <stefan@marxist.se>
Mon, 1 Aug 2022 16:15:51 +0000 (18:15 +0200)
committerStefan Kangas <stefan@marxist.se>
Mon, 1 Aug 2022 16:15:51 +0000 (18:15 +0200)
* lisp/textmodes/reftex-index.el (reftex-index-mode-map):
* lisp/textmodes/reftex-sel.el (reftex-select-shared-map):
* lisp/textmodes/reftex-toc.el (reftex-toc-mode-map): Prefer command
remapping to 'substitute-key-definition'.

lisp/textmodes/reftex-index.el
lisp/textmodes/reftex-sel.el
lisp/textmodes/reftex-toc.el

index b517cc1663482e657ca35913161540b7b8e8b8e4..075ad666b3d8c1b56fcb688c5db6ddfb1147ea90 100644 (file)
@@ -275,10 +275,8 @@ will prompt for other arguments."
     (define-key map [(mouse-2)] #'reftex-index-mouse-goto-line-and-hide)
     (define-key map [follow-link] 'mouse-face)
 
-    (substitute-key-definition
-     #'next-line #'reftex-index-next map global-map)
-    (substitute-key-definition
-     #'previous-line #'reftex-index-previous map global-map)
+    (define-key map [remap next-line] #'reftex-index-next)
+    (define-key map [remap previous-line] #'reftex-index-previous)
 
     (define-key map "n" #'reftex-index-next)
     (define-key map "p" #'reftex-index-previous)
index 5942801a8a906256758a512abe5f73ad841ed667..80c01948e5adbebb09041c6bf0eeb85298939798 100644 (file)
 (defvar reftex-select-shared-map
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map special-mode-map)
-    (substitute-key-definition
-     #'next-line #'reftex-select-next                      map global-map)
-    (substitute-key-definition
-     #'previous-line #'reftex-select-previous              map global-map)
-    (substitute-key-definition
-     #'keyboard-quit #'reftex-select-keyboard-quit         map global-map)
-    (substitute-key-definition
-     #'newline #'reftex-select-accept                      map global-map)
+    (define-key map [remap next-line] #'reftex-select-next)
+    (define-key map [remap previous-line] #'reftex-select-previous)
+    (define-key map [remap keyboard-quit] #'reftex-select-keyboard-quit)
+    (define-key map [remap newline] #'reftex-select-accept)
 
     (define-key map " " #'reftex-select-callback)
     (define-key map "n" #'reftex-select-next)
index 5599eaee024816d1e7c364cf02cdb88d13786a86..a7f3a9452a6a038d2a871ba205e6965c6fac816e 100644 (file)
     (define-key map [(mouse-2)] #'reftex-toc-mouse-goto-line-and-hide)
     (define-key map [follow-link] 'mouse-face)
 
-    (substitute-key-definition
-     'next-line 'reftex-toc-next map global-map)
-    (substitute-key-definition
-     'previous-line 'reftex-toc-previous map global-map)
+    (define-key map [remap next-line] #'reftex-toc-next)
+    (define-key map [remap previous-line] #'reftex-toc-previous)
 
     (define-key map "n" #'reftex-toc-next)
     (define-key map "p" #'reftex-toc-previous)