Re: [PATCH 2/2] emacs: Prefer email address over User ID when showing valid signature

2021-06-07 Thread Daniel Kahn Gillmor
On Mon 2021-06-07 13:07:12 +0100, David Edmondson wrote:
> Could this not be something like:
>
> (when (or email userid)
>   (setq label (concat "Good signature by: " (or email userid)))
>   ...
>   )
>
> ?

Sounds reasonable to me.  If you want to offer a revised patch for this,
i'd definitely defer to your expertise on idiomatic and concise elisp.

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 2/2] emacs: Prefer email address over User ID when showing valid signature

2021-06-07 Thread David Edmondson
On Wednesday, 2021-05-26 at 21:44:59 -04, Daniel Kahn Gillmor wrote:

> Most concrete verification steps are likely only taken on the e-mail
> address in the first place, and e-mail addresses render more
> intelligibly than arbitrary User IDs in the first place.
>
> Signed-off-by: Daniel Kahn Gillmor 
> ---
>  emacs/notmuch-crypto.el | 15 ++-
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
> index db7cb75d..5c260a7a 100644
> --- a/emacs/notmuch-crypto.el
> +++ b/emacs/notmuch-crypto.el
> @@ -119,14 +119,19 @@ mode."
>  (cond
>   ((string= status "good")
>(let ((fingerprint (concat "0x" (plist-get sigstatus :fingerprint)))
> + (email (plist-get sigstatus :email))
>   (userid (plist-get sigstatus :userid)))
> - ;; If userid is present it has full or greater validity.
> - (if userid
> + ;; If email or userid are present, they have full or greater validity.
> + (if email

Could this not be something like:

(when (or email userid)
  (setq label (concat "Good signature by: " (or email userid)))
  ...
  )

?

>   (progn
> -   (setq label (concat "Good signature by: " userid))
> +   (setq label (concat "Good signature by: " email))
> (setq face 'notmuch-crypto-signature-good))
> -   (setq label (concat "Good signature by key: " fingerprint))
> -   (setq face 'notmuch-crypto-signature-good-key))
> +   (if userid
> +   (progn
> + (setq label (concat "Good signature by: " userid))
> + (setq face 'notmuch-crypto-signature-good))
> + (setq label (concat "Good signature by key: " fingerprint))
> + (setq face 'notmuch-crypto-signature-good-key)))
>   (setq button-action 'notmuch-crypto-sigstatus-good-callback)
>   (setq help-msg (concat "Click to list key ID 0x" fingerprint "."
>   ((string= status "error")
> -- 
> 2.30.2
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org

dme.
-- 
If I could buy my reasoning, I'd pay to lose.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org