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

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

bug#42397: [PATCH 01/14] ; * lisp/epg.el (epg-signature-to-string): Use


From: Robert Pluim
Subject: bug#42397: [PATCH 01/14] ; * lisp/epg.el (epg-signature-to-string): Use cl-case.
Date: Thu, 16 Jul 2020 19:22:13 +0200

>>>>> On Thu, 16 Jul 2020 16:54:43 +0200, Jonas Bernoulli <jonas@bernoul.li> 
>>>>> said:

    Jonas> In this case we can greatly increase readability by using `cl-case'
    Jonas> instead of `cond'.
    Jonas> ---
    Jonas>  lisp/epg.el | 19 +++++++------------
    Jonas>  1 file changed, 7 insertions(+), 12 deletions(-)

    Jonas> diff --git a/lisp/epg.el b/lisp/epg.el
    Jonas> index 222fd913e1..e97db65b60 100644
    Jonas> --- a/lisp/epg.el
    Jonas> +++ b/lisp/epg.el
    Jonas> @@ -404,18 +404,13 @@ epg-signature-to-string
    Jonas>       (pubkey-algorithm (epg-signature-pubkey-algorithm signature))
    Jonas>       (key-id (epg-signature-key-id signature)))
    Jonas>      (concat
    Jonas> -     (cond ((eq (epg-signature-status signature) 'good)
    Jonas> -        "Good signature from ")
    Jonas> -       ((eq (epg-signature-status signature) 'bad)
    Jonas> -        "Bad signature from ")
    Jonas> -       ((eq (epg-signature-status signature) 'expired)
    Jonas> -        "Expired signature from ")
    Jonas> -       ((eq (epg-signature-status signature) 'expired-key)
    Jonas> -        "Signature made by expired key ")
    Jonas> -       ((eq (epg-signature-status signature) 'revoked-key)
    Jonas> -        "Signature made by revoked key ")
    Jonas> -       ((eq (epg-signature-status signature) 'no-pubkey)
    Jonas> -        "No public key for "))
    Jonas> +     (cl-case signature
    Jonas> +       (good "Good signature from ")
    Jonas> +       (bad  "Bad signature from ")
    Jonas> +       (expired "Expired signature from ")
    Jonas> +       (expired-key "Signature made by expired key ")
    Jonas> +       (revoked-key "Signature made by revoked key ")
    Jonas> +       (no-pubkey "No public key for "))

Did you drop the `epg-signature-status' accessor on purpose here?

Robert





reply via email to

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