From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id CPZgIzDOul+rTAAAsNZ9tg (envelope-from ) for ; Sun, 22 Nov 2020 20:46:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6JoSHzDOul8rVAAAbx9fmQ (envelope-from ) for ; Sun, 22 Nov 2020 20:46:40 +0000 Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1BEC69402D6 for ; Sun, 22 Nov 2020 20:46:40 +0000 (UTC) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id C1A8A10071F; Sun, 22 Nov 2020 15:46:38 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=jFpIsP0caqWNOkUzoUV4w2giF 48=; b=j89inQcuL+OAQZR+FOjpa/CbLxyFuCEf55dCty4XIH41oHv/Dqd9jtXdb 2XLpoe26ACBkYDADIM39ZV/BY5PYgO86RKmMBiKtQamQpJTRr3Al86mqfB1riWqx kkhkCMvXc1Xloyg/LucStozDui1VcH8dLV+8LPkCUnyYABNsfg= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id BAAA710071E; Sun, 22 Nov 2020 15:46:38 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=mesmtp; bh=as+xl78IuU45IGOcNHkAExD3efpNJtPeeN8U8IGMnL4=; b=nFzNoOVYnhoaNVNmjYIWIOG1NBBB3PrB6DEB4KemJhZkJ5m0auVe1V1SAL7MthfRldKaeibDiIfprApN3zcLuC62R2zGmuai5Q+bEjKkXOBh62vUakBZkz0WeHGcZkiXvR/Uy6fG+l4CGJF0dDA9hEOHCeAypqsjFEGT4nP4rII= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 2AA87100716; Sun, 22 Nov 2020 15:46:36 -0500 (EST) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH 3/4] Use when-let in a few more spots Date: Sun, 22 Nov 2020 15:46:08 -0500 Message-Id: <20201122204609.12604-4-kyle@kyleam.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201122204609.12604-1-kyle@kyleam.com> References: <20201122204609.12604-1-kyle@kyleam.com> MIME-Version: 1.0 X-Pobox-Relay-ID: CFF3EAE8-2D03-11EB-9579-E43E2BB96649-24757444!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=j89inQcu; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=nFzNoOVY; dmarc=none; spf=pass (aspmx1.migadu.com: domain of kyle@kyleam.com designates 173.228.157.52 as permitted sender) smtp.mailfrom=kyle@kyleam.com X-Spam-Score: 2.50 X-TUID: fVaWvYDSqT7X --- piem-gnus.el | 50 ++++++++++++++++++++++++------------------------- piem-notmuch.el | 23 +++++++++++------------ 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/piem-gnus.el b/piem-gnus.el index c1551ce..ca128fb 100644 --- a/piem-gnus.el +++ b/piem-gnus.el @@ -65,33 +65,31 @@ (defun piem-gnus-am-ready-mbox () (when (derived-mode-p 'gnus-article-mode 'gnus-summary-mode) (cond (gnus-article-mime-handles - (let ((patches - (delq nil - (mapcar (lambda (handle) - (and (listp handle) - (piem-am-patch-attachment-p - (mm-handle-media-type handle)) - (with-temp-buffer - (mm-display-inline handle) - (buffer-substring-no-properties - (point-min) (point-max))))) - gnus-article-mime-handles)))) - (when patches - (cons (lambda () - (dolist (patch patches) - (insert patch))) - "mbox")))) + (when-let ((patches + (delq nil + (mapcar (lambda (handle) + (and (listp handle) + (piem-am-patch-attachment-p + (mm-handle-media-type handle)) + (with-temp-buffer + (mm-display-inline handle) + (buffer-substring-no-properties + (point-min) (point-max))))) + gnus-article-mime-handles)))) + (cons (lambda () + (dolist (patch patches) + (insert patch))) + "mbox"))) (gnus-article-buffer - (let ((patch (with-current-buffer gnus-article-buffer - (save-restriction - (widen) - (and (string-match-p piem-patch-subject-re - (message-field-value "subjec= t")) - (buffer-substring-no-properties - (point-min) (point-max))))))) - (when patch - (cons (lambda () (insert patch)) - "mbox"))))))) + (when-let ((patch (with-current-buffer gnus-article-buffer + (save-restriction + (widen) + (and (string-match-p piem-patch-subject-re + (message-field-value "s= ubject")) + (buffer-substring-no-properties + (point-min) (point-max))))))) + (cons (lambda () (insert patch)) + "mbox")))))) =20 ;;;###autoload (define-minor-mode piem-gnus-mode diff --git a/piem-notmuch.el b/piem-notmuch.el index ccfae75..8f5ef77 100644 --- a/piem-notmuch.el +++ b/piem-notmuch.el @@ -88,18 +88,17 @@ (defun piem-notmuch-am-ready-mbox () (call-process notmuch-command nil t nil "show" "--format=3Dmbox" id)))) ("multipart/mixed" - (let ((patches - (delq nil - (mapcar (lambda (part) - (and (piem-am-patch-attachment-p - (plist-get part :content-type)) - (plist-get part :content))) - (plist-get body :content))))) - (when patches - (cons (lambda () - (dolist (patch patches) - (insert patch))) - "mbox")))))))) + (when-let ((patches + (delq nil + (mapcar (lambda (part) + (and (piem-am-patch-attachment-p + (plist-get part :content-type= )) + (plist-get part :content))) + (plist-get body :content))))) + (cons (lambda () + (dolist (patch patches) + (insert patch))) + "mbox"))))))) =20 ;;;###autoload (define-minor-mode piem-notmuch-mode --=20 2.29.2