summaryrefslogtreecommitdiff
path: root/lisp/epg.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2020-07-15 19:07:03 +0200
committerJonas Bernoulli <jonas@bernoul.li>2020-08-13 11:29:35 +0200
commit7ba75919ab0fc683afc304d67cf0d1bbe6d300e8 (patch)
tree57aff568358a0c132b8bcecbe69e7faa01d73f08 /lisp/epg.el
parent944608851c81e279287051c2a243faee7b59f3be (diff)
downloademacs-7ba75919ab0fc683afc304d67cf0d1bbe6d300e8.tar.gz
; * lisp/epg.el (epg-signature-to-string): Tiny refactor.
`concat' treats arguments that are nil as if they were empty strings. We therefore do not have to write (if TEST THEN "") and can just use (and TEST THEN).
Diffstat (limited to 'lisp/epg.el')
-rw-r--r--lisp/epg.el32
1 files changed, 14 insertions, 18 deletions
diff --git a/lisp/epg.el b/lisp/epg.el
index 65decf3cf5b..e53aa8caaaf 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -412,24 +412,20 @@ callback data (if any)."
(revoked-key "Signature made by revoked key ")
(no-pubkey "No public key for "))
key-id
- (if user-id
- (concat " "
- (if (stringp user-id)
- (epg--decode-percent-escape-as-utf-8 user-id)
- (epg-decode-dn user-id)))
- "")
- (if (epg-signature-validity signature)
- (format " (trust %s)" (epg-signature-validity signature))
- "")
- (if (epg-signature-creation-time signature)
- (format-time-string " created at %Y-%m-%dT%T%z"
- (epg-signature-creation-time signature))
- "")
- (if pubkey-algorithm
- (concat " using "
- (or (cdr (assq pubkey-algorithm epg-pubkey-algorithm-alist))
- (format "(unknown algorithm %d)" pubkey-algorithm)))
- ""))))
+ (and user-id
+ (concat " "
+ (if (stringp user-id)
+ (epg--decode-percent-escape-as-utf-8 user-id)
+ (epg-decode-dn user-id))))
+ (and (epg-signature-validity signature)
+ (format " (trust %s)" (epg-signature-validity signature)))
+ (and (epg-signature-creation-time signature)
+ (format-time-string " created at %Y-%m-%dT%T%z"
+ (epg-signature-creation-time signature)))
+ (and pubkey-algorithm
+ (concat " using "
+ (or (cdr (assq pubkey-algorithm epg-pubkey-algorithm-alist))
+ (format "(unknown algorithm %d)" pubkey-algorithm)))))))
(defun epg-verify-result-to-string (verify-result)
"Convert VERIFY-RESULT to a human readable string."