From 162f5896ae35b07a665f2c759582c634cc3a20f4 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 30 Aug 2021 18:35:35 +0300 Subject: [PATCH] mu4e-view: port of save-attachment fix Port of #b349b24 (courtesy of danielfleischer) to not fail to detect attachments in certain messages. --- mu4e/mu4e-view.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 1a30dd57..7227645e 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -1045,7 +1045,10 @@ containing commas." #'completing-read-multiple)) dir) (dolist (part parts) - (let ((fname (cdr (assoc 'filename (assoc "attachment" (cdr part)))))) + (let ((fname (or (cdr (assoc 'filename (assoc "attachment" (cdr part)))) + (cl-loop for item in part + for name = (and (listp item) (assoc-default 'name item)) + thereis (and (stringp name) name))))) (when fname (push `(,fname . ,(cdr part)) handles) (push fname files))))