From e1553142fefaf39d4742d1a161de2bce691204b2 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 3 Aug 2022 00:48:07 +0200 Subject: [PATCH] Prefer defvar-keymap in footnote.el * lisp/mail/footnote.el (footnote-mode-map) (footnote-minor-mode-map): Prefer defvar-keymap. --- lisp/mail/footnote.el | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index ab29a160963..a594fa3ccb4 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -840,22 +840,18 @@ being set it is automatically widened." (when (looking-at (footnote--current-regexp)) (goto-char (match-end 0)))))) -(defvar footnote-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "a" #'footnote-add-footnote) - (define-key map "b" #'footnote-back-to-message) - (define-key map "c" #'footnote-cycle-style) - (define-key map "d" #'footnote-delete-footnote) - (define-key map "g" #'footnote-goto-footnote) - (define-key map "r" #'footnote-renumber-footnotes) - (define-key map "s" #'footnote-set-style) - map)) - -(defvar footnote-minor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map footnote-prefix footnote-mode-map) - map) - "Keymap used for binding footnote minor mode.") +(defvar-keymap footnote-mode-map + "a" #'footnote-add-footnote + "b" #'footnote-back-to-message + "c" #'footnote-cycle-style + "d" #'footnote-delete-footnote + "g" #'footnote-goto-footnote + "r" #'footnote-renumber-footnotes + "s" #'footnote-set-style) + +(defvar-keymap footnote-minor-mode-map + :doc "Keymap used for binding footnote minor mode." + (key-description footnote-prefix) footnote-mode-map) (defmacro footnote--local-advice (mode variable function) "Add advice to a variable holding buffer-local functions. @@ -889,7 +885,6 @@ play around with the following keys: (footnote--local-advice footnote-mode fill-paragraph-function footnote--fill-paragraph) (when footnote-mode - ;; (footnote-setup-keybindings) (make-local-variable 'footnote-style) (make-local-variable 'footnote-body-tag-spacing) (make-local-variable 'footnote-spaced-footnotes) -- 2.39.2