bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41274: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command


From: Basil L. Contovounesios
Subject: bug#41274: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command
Date: Tue, 23 Jun 2020 23:57:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jonas Bernoulli <jonas@bernoul.li> writes:

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

If you prefer, you can avoid loading subr-x via

  (let ((key (or (get-text-property ...)
                 (error ...))))
    ...)

-- 
Basil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]