]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-keymap in lisp/epa*.el
authorStefan Kangas <stefankangas@gmail.com>
Mon, 12 Sep 2022 14:47:53 +0000 (16:47 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Tue, 13 Sep 2022 09:06:40 +0000 (11:06 +0200)
* lisp/epa-ks.el (epa-ks-search-mode-map):
* lisp/epa.el (epa-key-list-mode-map, epa-key-mode-map): Prefer
defvar-keymap.

lisp/epa-ks.el
lisp/epa.el

index 7c60b659f0abc90c9f0f63285d6644aabaa18a88..df8a72af70ebd1abff50c4d758db9269edc7db6f 100644 (file)
@@ -66,14 +66,12 @@ This is used by `epa-ks-lookup-key', for looking up public keys."
   "List of arguments to pass to `epa-search-keys'.
 This is used when reverting a buffer to restart search.")
 
-(defvar epa-ks-search-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map (kbd "f") #'epa-ks-mark-key-to-fetch)
-    (define-key map (kbd "i") #'epa-ks-inspect-key-to-fetch)
-    (define-key map (kbd "u") #'epa-ks-unmark-key-to-fetch)
-    (define-key map (kbd "x") #'epa-ks-do-key-to-fetch)
-    map))
+(defvar-keymap epa-ks-search-mode-map
+  :suppress t
+  "f" #'epa-ks-mark-key-to-fetch
+  "i" #'epa-ks-inspect-key-to-fetch
+  "u" #'epa-ks-unmark-key-to-fetch
+  "x" #'epa-ks-do-key-to-fetch)
 
 (define-derived-mode epa-ks-search-mode tabulated-list-mode "Keyserver"
   "Major mode for listing public key search results."
index 63bc0941d62a199d9fb43f99b818fda5b84412dd..cb87d80885763928c8fd5833b95b7b98dd9a5c88 100644 (file)
@@ -183,28 +183,26 @@ You should bind this variable with `let', but do not set it globally.")
 (defvar epa-suppress-error-buffer nil)
 (defvar epa-last-coding-system-specified nil)
 
-(defvar epa-key-list-mode-map
-  (let ((keymap (make-sparse-keymap)))
-    (define-key keymap "\C-m" 'epa-show-key)
-    (define-key keymap [?\t] 'forward-button)
-    (define-key keymap [backtab] 'backward-button)
-    (define-key keymap "m" 'epa-mark-key)
-    (define-key keymap "u" 'epa-unmark-key)
-    (define-key keymap "d" 'epa-decrypt-file)
-    (define-key keymap "v" 'epa-verify-file)
-    (define-key keymap "s" 'epa-sign-file)
-    (define-key keymap "e" 'epa-encrypt-file)
-    (define-key keymap "r" 'epa-delete-keys)
-    (define-key keymap "i" 'epa-import-keys)
-    (define-key keymap "o" 'epa-export-keys)
-    (define-key keymap "g" 'revert-buffer)
-    (define-key keymap "n" 'next-line)
-    (define-key keymap "p" 'previous-line)
-    (define-key keymap " " 'scroll-up-command)
-    (define-key keymap [?\S-\ ] 'scroll-down-command)
-    (define-key keymap [delete] 'scroll-down-command)
-    (define-key keymap "q" 'epa-exit-buffer)
-    keymap))
+(defvar-keymap epa-key-list-mode-map
+  "RET"       #'epa-show-key
+  "TAB"       #'forward-button
+  "<backtab>" #'backward-button
+  "m"         #'epa-mark-key
+  "u"         #'epa-unmark-key
+  "d"         #'epa-decrypt-file
+  "v"         #'epa-verify-file
+  "s"         #'epa-sign-file
+  "e"         #'epa-encrypt-file
+  "r"         #'epa-delete-keys
+  "i"         #'epa-import-keys
+  "o"         #'epa-export-keys
+  "g"         #'revert-buffer
+  "n"         #'next-line
+  "p"         #'previous-line
+  "SPC"       #'scroll-up-command
+  "S-SPC"     #'scroll-down-command
+  "<delete>"  #'scroll-down-command
+  "q"         #'epa-exit-buffer)
 
 (easy-menu-define epa-key-list-mode-menu epa-key-list-mode-map
   "Menu for `epa-key-list-mode'."
@@ -230,10 +228,8 @@ You should bind this variable with `let', but do not set it globally.")
     ["Unmark Key" epa-unmark-key
      :help "Unmark a key"]))
 
-(defvar epa-key-mode-map
-  (let ((keymap (make-sparse-keymap)))
-    (define-key keymap "q" 'epa-exit-buffer)
-    keymap))
+(defvar-keymap epa-key-mode-map
+  "q" #'epa-exit-buffer)
 
 (defvar epa-exit-buffer-function #'quit-window)