]> git.eshelyaron.com Git - emacs.git/commitdiff
Use defvar-keymap for command-history-mode-map
authorStefan Kangas <stefankangas@gmail.com>
Fri, 14 Mar 2025 22:11:15 +0000 (23:11 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Mar 2025 17:11:40 +0000 (18:11 +0100)
* lisp/chistory.el (command-history-mode-map): Use defvar-keymap.

(cherry picked from commit 6b295347a9f7491ae4c16d942b3b12a54fc2373a)

lisp/chistory.el

index 110edbeceee42082a836d2dfafc8318232295bf4..7b2c678418b0c62ba027e86f57d4f95d8e7770a7 100644 (file)
@@ -117,16 +117,14 @@ The buffer is left in Command History mode."
          (error "No command history")
        (command-history-mode)))))
 
-(defvar command-history-mode-map
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-parent map (make-composed-keymap lisp-mode-shared-map
-                                                 special-mode-map))
-    (define-key map "x" #'command-history-repeat)
-    (define-key map "\n" #'next-line)
-    (define-key map "\r" #'next-line)
-    (define-key map "\177" #'previous-line)
-    map)
-  "Keymap for `command-history-mode'.")
+(defvar-keymap command-history-mode-map
+  :doc "Keymap for `command-history-mode'."
+  :parent (make-composed-keymap lisp-mode-shared-map
+                                special-mode-map)
+  "x"   #'command-history-repeat
+  "C-j" #'next-line
+  "RET" #'next-line
+  "DEL" #'previous-line)
 
 (define-derived-mode command-history-mode special-mode "Command History"
   "Major mode for listing and repeating recent commands.