[PATCH 3/4] emacs: notmuch-show--get-cid-content: cosmetics

Subject: [PATCH 3/4] emacs: notmuch-show--get-cid-content: cosmetics

Date: Sun, 10 Jan 2021 19:47:21 +0100

To: notmuch@notmuchmail.org

Cc:

From: Jonas Bernoulli


---
 emacs/notmuch-show.el | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 21133611..8c846fb2 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -599,16 +599,13 @@ (defun notmuch-show--get-cid-content (cid)
 into the current buffer.  CID must be a raw content ID, without
 enclosing angle brackets, a cid: prefix, or URL encoding.  This
 will return nil if the CID is unknown or cannot be retrieved."
-  (let ((descriptor (cdr (assoc cid notmuch-show--cids))))
-    (when descriptor
-      (let* ((msg (car descriptor))
-	     (part (cadr descriptor))
-	     ;; Request caching for this content, as some messages
-	     ;; reference the same cid: part many times (hundreds!).
-	     (content (notmuch-get-bodypart-binary
-		       msg part notmuch-show-process-crypto 'cache))
-	     (content-type (plist-get part :content-type)))
-	(list content content-type)))))
+  (when-let ((descriptor (cdr (assoc cid notmuch-show--cids))))
+    (pcase-let ((`(,msg ,part) descriptor))
+      ;; Request caching for this content, as some messages
+      ;; reference the same cid: part many times (hundreds!).
+      (list (notmuch-get-bodypart-binary
+	     msg part notmuch-show-process-crypto 'cache)
+	    (plist-get part :content-type)))))
 
 (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
-- 
2.30.0
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: