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

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Thu, 14 May 2020 19:14:05 UTC

Severity: normal

Tags: patch

Merged with 41268, 41269, 41270, 41271, 41272, 41273, 41275, 41276, 41277

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 41274 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Jonas Bernoulli <jonas <at> bernoul.li>
Cc: 41274 <at> debbugs.gnu.org
Subject: Re: bug#41274: [PATCH 9/9] * lisp/epa.el (epa-show-key): New command
Date: Tue, 23 Jun 2020 23:57:37 +0100
Jonas Bernoulli <jonas <at> 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




This bug report was last modified 4 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.