From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0MDdGNRL+19fTwAA0tVLHw (envelope-from ) for ; Sun, 10 Jan 2021 18:47:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OPq4FNRL+1+tHgAA1q6Kng (envelope-from ) for ; Sun, 10 Jan 2021 18:47:48 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 12AF0940481 for ; Sun, 10 Jan 2021 18:47:48 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E5A0C29E57; Sun, 10 Jan 2021 13:47:30 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 1238629D05 for ; Sun, 10 Jan 2021 13:47:23 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 22FA1160DD for ; Sun, 10 Jan 2021 19:47:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=sel2011a; t=1610304443; bh=IbqjUUMdRwOhz6h eFmj+potMNVDTOcFMRD7W//the74=; b=NRehy4BiPh6XpowLUVRolnksRg/HDLa e+QrOiooqfOXGFDSX1iJDw+wBuRlxTMQsv7Vo1GUo8PX+4o4DLO5+lhIn3/Da2RA dCN0Xk/vJNBEw6ruOK+FLNa+Jn6R2GQaK4XjyM7/OqB30RzgHrAz5e5+9sHYpWUL IPzvL72tlaEA= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id 55MaZHuNIhFj for ; Sun, 10 Jan 2021 19:47:23 +0100 (CET) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id E6D4F16400 for ; Sun, 10 Jan 2021 19:47:22 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH 3/4] emacs: notmuch-show--get-cid-content: cosmetics Date: Sun, 10 Jan 2021 19:47:21 +0100 Message-Id: <20210110184722.29294-4-jonas@bernoul.li> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210110184722.29294-1-jonas@bernoul.li> References: <20210110184722.29294-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: YASJVDJE3QKYYVPAX6ZAEMPHIN7VVIM5 X-Message-ID-Hash: YASJVDJE3QKYYVPAX6ZAEMPHIN7VVIM5 X-MailFrom: jonas@bernoul.li X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 0.06 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=bernoul.li header.s=sel2011a header.b=NRehy4Bi; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 12AF0940481 X-Spam-Score: 0.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: C1Lliwnuizsv --- 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