[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: |
Jonas Bernoulli |
Subject: |
bug#42397: [PATCH 01/14] ; * lisp/epg.el (epg-signature-to-string): Use cl-case. |
Date: |
Thu, 16 Jul 2020 16:54:43 +0200 |
In this case we can greatly increase readability by using `cl-case'
instead of `cond'.
---
lisp/epg.el | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/lisp/epg.el b/lisp/epg.el
index 222fd913e1..e97db65b60 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -404,18 +404,13 @@ epg-signature-to-string
(pubkey-algorithm (epg-signature-pubkey-algorithm signature))
(key-id (epg-signature-key-id signature)))
(concat
- (cond ((eq (epg-signature-status signature) 'good)
- "Good signature from ")
- ((eq (epg-signature-status signature) 'bad)
- "Bad signature from ")
- ((eq (epg-signature-status signature) 'expired)
- "Expired signature from ")
- ((eq (epg-signature-status signature) 'expired-key)
- "Signature made by expired key ")
- ((eq (epg-signature-status signature) 'revoked-key)
- "Signature made by revoked key ")
- ((eq (epg-signature-status signature) 'no-pubkey)
- "No public key for "))
+ (cl-case signature
+ (good "Good signature from ")
+ (bad "Bad signature from ")
+ (expired "Expired signature from ")
+ (expired-key "Signature made by expired key ")
+ (revoked-key "Signature made by revoked key ")
+ (no-pubkey "No public key for "))
key-id
(if user-id
(concat " "
--
2.26.0
- bug#42397: [PATCH 00/14] Use outline headings and some cosmetics, Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 01/14] ; * lisp/epg.el (epg-signature-to-string): Use cl-case.,
Jonas Bernoulli <=
- bug#42397: [PATCH 02/14] ; * lisp/epg.el (epg-signature-to-string): Tiny refactor., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 03/14] ; * lisp/epg.el (epg-no-data-reason-alist): Fix typo in message., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 04/14] * lisp/epa.el (epa--derived-mode-p): Remove unnecessary alias., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 05/14] Split EasyPG libraries into outline sections, Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 06/14] * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Fix indentation., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 07/14] * lisp/progmodes/compile.el: Remove unnecessary comments., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 08/14] ; * lisp/whitespace.el: Capitalize "Code" section heading., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 09/14] * lisp/mail/smtpmail.el: Use outline headings., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 10/14] * test/src/emacs-module-tests.el: Use proper outline headings., Jonas Bernoulli, 2020/07/16
- bug#42397: [PATCH 11/14] * lisp/obsolete/longlines.el: Use proper outline headings., Jonas Bernoulli, 2020/07/16