]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-keymap in mail/*.el
authorStefan Kangas <stefan@marxist.se>
Thu, 4 Aug 2022 21:35:46 +0000 (23:35 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 4 Aug 2022 21:35:46 +0000 (23:35 +0200)
* lisp/mail/mspools.el (mspools-mode-map):
* lisp/mail/rmailedit.el (rmail-edit-map):
* lisp/mail/rmailsum.el (rmail-summary-edit-map):
* lisp/mail/supercite.el (sc-T-keymap, sc-mode-map)
(sc-electric-mode-map, sc-minibuffer-local-completion-map)
(sc-minibuffer-local-map): Prefer defvar-keymap.

lisp/mail/mspools.el
lisp/mail/rmailedit.el
lisp/mail/rmailsum.el
lisp/mail/supercite.el

index 4dcde0d35456aaba06adef9e5c03179b3ab56243..2ab4fa411a6bfc0c79d39df52cc6e3a676888b28 100644 (file)
@@ -164,17 +164,13 @@ your primary spool is.  If this fails, set it to something like
 (defvar mspools-buffer "*spools*"
   "Name of buffer for displaying spool info.")
 
-(defvar mspools-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\C-c\C-c" #'mspools-visit-spool)
-    (define-key map "\C-m" #'mspools-visit-spool)
-    (define-key map " " #'mspools-visit-spool)
-    (define-key map "n" #'next-line)
-    (define-key map "p" #'previous-line)
-    map)
-  "Keymap for the *spools* buffer.")
-
-;;; Code
+(defvar-keymap mspools-mode-map
+  :doc "Keymap for the *spools* buffer."
+  "C-c C-c" #'mspools-visit-spool
+  "RET"     #'mspools-visit-spool
+  "SPC"     #'mspools-visit-spool
+  "n"       #'next-line
+  "p"       #'previous-line)
 
 ;;; VM Specific code
 (if mspools-using-vm
index 79bd02fd67ec4d968c66e4606cf3589366e968e8..553fac26f9e4f9a3ad955825da629d69359dd2d7 100644 (file)
   :group 'rmail-edit)
 
 
-(defvar rmail-edit-map
-  (let ((map (make-sparse-keymap)))
-    ;; Make a keymap that inherits text-mode-map.
-    (set-keymap-parent map text-mode-map)
-    (define-key map "\C-c\C-c" #'rmail-cease-edit)
-    (define-key map "\C-c\C-]" #'rmail-abort-edit)
-    map))
+(defvar-keymap rmail-edit-map
+  :parent text-mode-map
+  "C-c C-c" #'rmail-cease-edit
+  "C-c C-]" #'rmail-abort-edit)
 
 (declare-function rmail-summary-disable "rmailsum" ())
 
index b23fbc3f60061432039866464d725030b1b3fd56..cc76df718c23f601cf0da90394e8243ea3635313 100644 (file)
@@ -1480,11 +1480,10 @@ argument says to read a file name and use that file as the inbox."
 (declare-function rmail-output-read-file-name "rmailout" ())
 (declare-function mail-send-and-exit "sendmail" (&optional arg))
 
-(defvar rmail-summary-edit-map
-  (let ((map (nconc (make-sparse-keymap) text-mode-map)))
-    (define-key map "\C-c\C-c" #'rmail-cease-edit)
-    (define-key map "\C-c\C-]" #'rmail-abort-edit)
-    map))
+(defvar-keymap rmail-summary-edit-map
+  :parent text-mode-map
+  "C-c C-c" #'rmail-cease-edit
+  "C-c C-]" #'rmail-abort-edit)
 
 (defun rmail-summary-edit-current-message ()
   "Edit the contents of this message."
index 3f8a940382e41b81d68e0b44009228700c5e567f..98f46a3af550ca23e407efc97e88ef75bf2e5f16 100644 (file)
@@ -520,75 +520,67 @@ string."
 ;; ======================================================================
 ;; supercite keymaps
 
-(defvar sc-T-keymap
-  (let ((map (make-sparse-keymap)))
-    (define-key map "a" #'sc-S-preferred-attribution-list)
-    (define-key map "b" #'sc-T-mail-nuke-blank-lines)
-    (define-key map "c" #'sc-T-confirm-always)
-    (define-key map "d" #'sc-T-downcase)
-    (define-key map "e" #'sc-T-electric-references)
-    (define-key map "f" #'sc-T-auto-fill-region)
-    (define-key map "h" #'sc-T-describe)
-    (define-key map "l" #'sc-S-cite-region-limit)
-    (define-key map "n" #'sc-S-mail-nuke-mail-headers)
-    (define-key map "N" #'sc-S-mail-header-nuke-list)
-    (define-key map "o" #'sc-T-electric-circular)
-    (define-key map "p" #'sc-S-preferred-header-style)
-    (define-key map "s" #'sc-T-nested-citation)
-    (define-key map "u" #'sc-T-use-only-preferences)
-    (define-key map "w" #'sc-T-fixup-whitespace)
-    (define-key map "?" #'sc-T-describe)
-    map)
-  "Keymap for sub-keymap of setting and toggling functions.")
-
-(defvar sc-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "c"    #'sc-cite-region)
-    (define-key map "f"    #'sc-mail-field-query)
-    (define-key map "g"    #'sc-mail-process-headers)
-    (define-key map "h"    #'sc-describe)
-    (define-key map "i"    #'sc-insert-citation)
-    (define-key map "o"    #'sc-open-line)
-    (define-key map "r"    #'sc-recite-region)
-    (define-key map "\C-p" #'sc-raw-mode-toggle)
-    (define-key map "u"    #'sc-uncite-region)
-    (define-key map "w"    #'sc-insert-reference)
-    (define-key map "\C-t"   sc-T-keymap)
-    (define-key map "?"    #'sc-describe)
-    map)
-  "Keymap for Supercite quasi-mode.")
-
-(defvar sc-electric-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "p"    #'sc-eref-prev)
-    (define-key map "n"    #'sc-eref-next)
-    (define-key map "s"    #'sc-eref-setn)
-    (define-key map "j"    #'sc-eref-jump)
-    (define-key map "x"    #'sc-eref-abort)
-    (define-key map "q"    #'sc-eref-abort)
-    (define-key map "\r"   #'sc-eref-exit)
-    (define-key map "\n"   #'sc-eref-exit)
-    (define-key map "g"    #'sc-eref-goto)
-    (define-key map "?"    #'describe-mode)
-    (define-key map "\C-h" #'describe-mode)
-    (define-key map [f1]   #'describe-mode)
-    (define-key map [help] #'describe-mode)
-    map)
-  "Keymap for `sc-electric-mode' electric references mode.")
-
-
-(defvar sc-minibuffer-local-completion-map
-  (let ((map (copy-keymap minibuffer-local-completion-map)))
-    (define-key map "\C-t" #'sc-toggle-fn)
-    (define-key map " "    #'self-insert-command)
-    map)
-  "Keymap for minibuffer confirmation of attribution strings.")
-
-(defvar sc-minibuffer-local-map
-  (let ((map (copy-keymap minibuffer-local-map)))
-    (define-key map "\C-t" #'sc-toggle-fn)
-    map)
-  "Keymap for minibuffer confirmation of attribution strings.")
+(defvar-keymap sc-T-keymap
+  :doc "Keymap for sub-keymap of setting and toggling functions."
+  "a" #'sc-S-preferred-attribution-list
+  "b" #'sc-T-mail-nuke-blank-lines
+  "c" #'sc-T-confirm-always
+  "d" #'sc-T-downcase
+  "e" #'sc-T-electric-references
+  "f" #'sc-T-auto-fill-region
+  "h" #'sc-T-describe
+  "l" #'sc-S-cite-region-limit
+  "n" #'sc-S-mail-nuke-mail-headers
+  "N" #'sc-S-mail-header-nuke-list
+  "o" #'sc-T-electric-circular
+  "p" #'sc-S-preferred-header-style
+  "s" #'sc-T-nested-citation
+  "u" #'sc-T-use-only-preferences
+  "w" #'sc-T-fixup-whitespace
+  "?" #'sc-T-describe)
+
+(defvar-keymap sc-mode-map
+  :doc "Keymap for Supercite quasi-mode."
+  "c"   #'sc-cite-region
+  "f"   #'sc-mail-field-query
+  "g"   #'sc-mail-process-headers
+  "h"   #'sc-describe
+  "i"   #'sc-insert-citation
+  "o"   #'sc-open-line
+  "r"   #'sc-recite-region
+  "C-p" #'sc-raw-mode-toggle
+  "u"   #'sc-uncite-region
+  "w"   #'sc-insert-reference
+  "C-t" sc-T-keymap
+  "?"   #'sc-describe)
+
+(defvar-keymap sc-electric-mode-map
+  :doc "Keymap for `sc-electric-mode' electric references mode."
+  "p"      #'sc-eref-prev
+  "n"      #'sc-eref-next
+  "s"      #'sc-eref-setn
+  "j"      #'sc-eref-jump
+  "x"      #'sc-eref-abort
+  "q"      #'sc-eref-abort
+  "RET"    #'sc-eref-exit
+  "C-j"    #'sc-eref-exit
+  "g"      #'sc-eref-goto
+  "?"      #'describe-mode
+  "C-h"    #'describe-mode
+  "<f1>"   #'describe-mode
+  "<help>" #'describe-mode)
+
+
+(defvar-keymap sc-minibuffer-local-completion-map
+  :doc "Keymap for minibuffer confirmation of attribution strings."
+  :parent minibuffer-local-completion-map
+  "C-t" #'sc-toggle-fn
+  "SPC" #'self-insert-command)
+
+(defvar-keymap sc-minibuffer-local-map
+  :doc "Keymap for minibuffer confirmation of attribution strings."
+  :parent minibuffer-local-map
+  "C-t" #'sc-toggle-fn)
 
 \f
 ;; ======================================================================