[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41276: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command
From: |
Jonas Bernoulli |
Subject: |
bug#41276: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command |
Date: |
Thu, 14 May 2020 22:16:18 +0200 |
Users can move in `epa-key-list-mode' buffers using either
`next-line'/`previous-line' or `widget-forward'/`widget-backward'.
When using the first set of commands, then the cursor stays in the
column and that normally is the first column. The key widgets do
not begin until the third character of their respective lines.
All `epa' commands work regardless of whether the cursor is on the
widget or before them. The `epa-show-key' command did not exist until
now because the `widget-button-press' already performs its task. But
because the widgets don't span complete lines we actually need this
command too.
---
lisp/epa.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lisp/epa.el b/lisp/epa.el
index 1e0a0132d2..fe5dd4321a 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -25,7 +25,9 @@
(require 'epg)
(require 'font-lock)
(require 'widget)
-(eval-when-compile (require 'wid-edit))
+(eval-when-compile
+ (require 'subr-x)
+ (require 'wid-edit))
(require 'derived)
;;; Options
@@ -192,6 +194,7 @@ epa-key-list-mode-map
(let ((keymap (make-sparse-keymap))
(menu-map (make-sparse-keymap)))
(set-keymap-parent keymap widget-keymap)
+ (define-key keymap "\C-m" 'epa-show-key)
(define-key keymap "m" 'epa-mark-key)
(define-key keymap "u" 'epa-unmark-key)
(define-key keymap "d" 'epa-decrypt-file)
@@ -518,6 +521,14 @@ epa-select-keys
;;;; Key Details
+(defun epa-show-key ()
+ "Show a key on the current line."
+ (interactive)
+ (if-let ((key (get-text-property (point) 'epa-key)))
+ (save-selected-window
+ (epa--show-key key))
+ (error "No key on this line")))
+
(defun epa--show-key (key)
(let* ((primary-sub-key (car (epg-key-sub-key-list key)))
(entry (assoc (epg-sub-key-id primary-sub-key)
--
2.26.0
- bug#41276: Acknowledgement ([PATCH 0/9] Various small improvements to EasyPG), (continued)
- bug#41276: [PATCH 1/9] * lisp/epa.el (epa-faces): Move definition, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 2/9] Add all epa faces to epa-faces Custom group, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 6/9] Drop unnecessary backward compatibility aliases, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 3/9] * lisp/epg-config.el (epg-config--make-gpg-configuration): Fix indentation, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 8/9] epa-key-list-mode-map: Use widget-keymap as parent keymap, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 5/9] Improve and add doc-strings, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 7/9] Cosmetic changes to epa libraries, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command,
Jonas Bernoulli <=
- bug#41276: [PATCH 4/9] Split EasyPG libraries into outline sections, Jonas Bernoulli, 2020/05/14
- bug#41276: [PATCH 0/9] Various small improvements to EasyPG, Stefan Kangas, 2020/05/14