From 57f802b2a43ac64c28a5a9ddb9da0afaf910975e Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 4 Jan 2021 01:54:48 +0000 Subject: gnus, notmuch: Absorb now-shared bits into patch attachment helper With the previous commit, -notmuch more closely follows -gnus in its handling of attachments (e.g., getting the content with mm-display-inline). Replace piem-am-patch-attachment-p with a helper that has this shared logic. Message-Id: <20210104015435.18397-4-kyle@kyleam.com> --- piem-gnus.el | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'piem-gnus.el') diff --git a/piem-gnus.el b/piem-gnus.el index c6b9d0c..5f10be8 100644 --- a/piem-gnus.el +++ b/piem-gnus.el @@ -66,18 +66,8 @@ message itself if it looks like a patch." (when (derived-mode-p 'gnus-article-mode 'gnus-summary-mode) (cond (gnus-article-mime-handles - (when-let ((patches - (delq nil - (mapcar (lambda (handle) - (and (listp handle) - (piem-am-patch-attachment-p - (mm-handle-media-type handle) - (mm-handle-filename handle)) - (with-temp-buffer - (mm-display-inline handle) - (buffer-substring-no-properties - (point-min) (point-max))))) - gnus-article-mime-handles)))) + (when-let ((patches (delq nil (mapcar #'piem-am-extract-attached-patch + gnus-article-mime-handles)))) (cons (lambda () (dolist (patch patches) (insert patch))) -- cgit v1.2.3