[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42397: [PATCH v2 02/16] ; * lisp/epg.el (epg-signature-to-string): T
From: |
Jonas Bernoulli |
Subject: |
bug#42397: [PATCH v2 02/16] ; * lisp/epg.el (epg-signature-to-string): Tiny refactor. |
Date: |
Mon, 10 Aug 2020 23:14:16 +0200 |
`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).
---
lisp/epg.el | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/lisp/epg.el b/lisp/epg.el
index 65decf3cf5..e53aa8caaa 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -412,24 +412,20 @@ epg-signature-to-string
(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."
--
2.28.0
- bug#42397: [PATCH v2 00/16] Use outline headings and some cosmetics, Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 01/16] ; * lisp/epg.el (epg-signature-to-string): Use cl-case., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 02/16] ; * lisp/epg.el (epg-signature-to-string): Tiny refactor.,
Jonas Bernoulli <=
- bug#42397: [PATCH v2 04/16] * lisp/epa.el (epa--derived-mode-p): Remove unnecessary alias., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 05/16] Split EasyPG libraries into outline sections, Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 06/16] Merge two conditions and fix indentation, Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 03/16] ; * lisp/epg.el (epg-no-data-reason-alist): Fix typo in message., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 07/16] * lisp/progmodes/compile.el: Remove unnecessary comments., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 08/16] ; * lisp/whitespace.el: Capitalize "Code" section heading., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 09/16] * lisp/mail/smtpmail.el: Use outline headings., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 11/16] * lisp/obsolete/longlines.el: Use proper outline headings., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 10/16] * test/src/emacs-module-tests.el: Use proper outline headings., Jonas Bernoulli, 2020/08/10
- bug#42397: [PATCH v2 15/16] ; * lisp/emacs-lisp/autoload.el: Begin summary line with three semicolons., Jonas Bernoulli, 2020/08/10