]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/scroll-lock.el (scroll-lock-mode-map): Prefer defvar-keymap.
authorStefan Kangas <stefan@marxist.se>
Tue, 10 May 2022 21:13:19 +0000 (23:13 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 11 May 2022 14:12:00 +0000 (16:12 +0200)
lisp/scroll-lock.el

index 3f5f777f53f3e12495041e4131c4a5b1c9c04145..fa1f3a633b567163cf0fa4e5eb3c609278a94f96 100644 (file)
 
 ;;; Code:
 
-(defvar scroll-lock-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap next-line] 'scroll-lock-next-line)
-    (define-key map [remap previous-line] 'scroll-lock-previous-line)
-    (define-key map [remap forward-paragraph] 'scroll-lock-forward-paragraph)
-    (define-key map [remap backward-paragraph] 'scroll-lock-backward-paragraph)
-    (define-key map [S-down] 'scroll-lock-next-line-always-scroll)
-    map)
-  "Keymap for Scroll Lock mode.")
+(defvar-keymap scroll-lock-mode-map
+  :doc "Keymap for Scroll Lock mode."
+  "<remap> <next-line>"          #'scroll-lock-next-line
+  "<remap> <previous-line>"      #'scroll-lock-previous-line
+  "<remap> <forward-paragraph>"  #'scroll-lock-forward-paragraph
+  "<remap> <backward-paragraph>" #'scroll-lock-backward-paragraph
+  "S-<down>"                     #'scroll-lock-next-line-always-scroll)
 
 (defvar-local scroll-lock-preserve-screen-pos-save scroll-preserve-screen-position
   "Used for saving the state of `scroll-preserve-screen-position'.")