1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

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.
This commit is contained in:
Stefan Kangas 2021-02-25 12:54:58 +01:00
parent 4b1ace22be
commit 4d43b9a0b0

View File

@ -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)