summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-02-25 12:54:58 +0100
committerStefan Kangas <stefan@marxist.se>2021-02-25 12:56:12 +0100
commit4d43b9a0b0ba2a2f233d81165c6d410a7de61d1d (patch)
tree63236b14e538fdb237d389da5548ff7a2e5f30fc
parent4b1ace22be661c15a52bc84c0ee8c0c8c5fe8595 (diff)
downloademacs-4d43b9a0b0ba2a2f233d81165c6d410a7de61d1d.tar.gz
Convert epa-key-list-mode menu to easy-menu-define
* lisp/epa.el (epa-key-list-mode-map): Move menu from here... (epa-key-list-mode-menu): ...to here, and convert to easy-menu-define.
-rw-r--r--lisp/epa.el57
1 files changed, 25 insertions, 32 deletions
diff --git a/lisp/epa.el b/lisp/epa.el
index 572c947e4b2..bbfa2c188cc 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -183,8 +183,7 @@ You should bind this variable with `let', but do not set it globally.")
(defvar epa-last-coding-system-specified nil)
(defvar epa-key-list-mode-map
- (let ((keymap (make-sparse-keymap))
- (menu-map (make-sparse-keymap)))
+ (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)
@@ -204,38 +203,32 @@ You should bind this variable with `let', but do not set it globally.")
(define-key keymap [?\S-\ ] 'scroll-down-command)
(define-key keymap [delete] 'scroll-down-command)
(define-key keymap "q" 'epa-exit-buffer)
- (define-key keymap [menu-bar epa-key-list-mode] (cons "Keys" menu-map))
- (define-key menu-map [epa-key-list-unmark-key]
- '(menu-item "Unmark Key" epa-unmark-key
- :help "Unmark a key"))
- (define-key menu-map [epa-key-list-mark-key]
- '(menu-item "Mark Key" epa-mark-key
- :help "Mark a key"))
- (define-key menu-map [separator-epa-file] '(menu-item "--"))
- (define-key menu-map [epa-verify-file]
- '(menu-item "Verify File..." epa-verify-file
- :help "Verify FILE"))
- (define-key menu-map [epa-sign-file]
- '(menu-item "Sign File..." epa-sign-file
- :help "Sign FILE by SIGNERS keys selected"))
- (define-key menu-map [epa-decrypt-file]
- '(menu-item "Decrypt File..." epa-decrypt-file
- :help "Decrypt FILE"))
- (define-key menu-map [epa-encrypt-file]
- '(menu-item "Encrypt File..." epa-encrypt-file
- :help "Encrypt FILE for RECIPIENTS"))
- (define-key menu-map [separator-epa-key-list] '(menu-item "--"))
- (define-key menu-map [epa-key-list-delete-keys]
- '(menu-item "Delete Keys" epa-delete-keys
- :help "Delete Marked Keys"))
- (define-key menu-map [epa-key-list-import-keys]
- '(menu-item "Import Keys" epa-import-keys
- :help "Import keys from a file"))
- (define-key menu-map [epa-key-list-export-keys]
- '(menu-item "Export Keys" epa-export-keys
- :help "Export marked keys to a file"))
keymap))
+(easy-menu-define epa-key-list-mode-menu epa-key-list-mode-map
+ "Menu for `epa-key-list-mode'."
+ '("Keys"
+ ["Export Keys" epa-export-keys
+ :help "Export marked keys to a file"]
+ ["Import Keys" epa-import-keys
+ :help "Import keys from a file"]
+ ["Delete Keys" epa-delete-keys
+ :help "Delete Marked Keys"]
+ "---"
+ ["Encrypt File..." epa-encrypt-file
+ :help "Encrypt file for recipients"]
+ ["Decrypt File..." epa-decrypt-file
+ :help "Decrypt file"]
+ ["Sign File..." epa-sign-file
+ :help "Sign file by signers keys selected"]
+ ["Verify File..." epa-verify-file
+ :help "Verify file"]
+ "---"
+ ["Mark Key" epa-mark-key
+ :help "Mark a key"]
+ ["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)