From 6b295347a9f7491ae4c16d942b3b12a54fc2373a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 14 Mar 2025 23:11:15 +0100 Subject: [PATCH] Use defvar-keymap for command-history-mode-map * lisp/chistory.el (command-history-mode-map): Use defvar-keymap. --- lisp/chistory.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lisp/chistory.el b/lisp/chistory.el index 6ccbd2f2df0..8d8ec7eda01 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el @@ -119,16 +119,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.