summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Ingram <thomas@taingram.org>2025-12-19 16:55:26 -0500
committerThomas Ingram <thomas@taingram.org>2025-12-19 19:51:24 -0500
commit3a5c9e8c87828b5ba8f7db6ec7170019b7a0ca1d (patch)
treeab87d0d2149f3ee522032abfbba9e8e125d2c4e2
parentcc191bdbe9e5f96569600fc448a9bd681493fd18 (diff)
mu4e: save all attachments if none are selected
Updates the behavior of `mu4e-view-save-attachments' to allow saving all attachments. If no files are selected in the completing-read then assume all files should be downloaded to the selected directory.
-rw-r--r--mu4e/mu4e-mime-parts.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/mu4e/mu4e-mime-parts.el b/mu4e/mu4e-mime-parts.el
index 058c53b..d06cdb5 100644
--- a/mu4e/mu4e-mime-parts.el
+++ b/mu4e/mu4e-mime-parts.el
@@ -290,8 +290,10 @@ Optionally,
(defun mu4e-view-save-attachments (&optional ask-dir)
"Save files from the current view buffer.
-This applies to all MIME-parts that are \"attachment-like\" (have
-a filename), regardless of their disposition.
+Save the specific files selected, if no files are explicitly
+selected then all attachments will be saved. Note all MIME-parts
+that are \"attachment-like\" (have a filename) will be considered
+a file regardless of their disposition.
With ASK-DIR is non-nil, user can specify the target-directory; otherwise
one is determined using `mu4e-attachment-dir'.
@@ -321,8 +323,9 @@ files."
parts)))
(candidates (or candidates
(mu4e-warn "No attachments for this message")))
- (files (mu4e--completing-read "Save file(s): " candidates
- 'attachment 'multi))
+ (files (or (mu4e--completing-read "Save files (default ALL): " candidates
+ 'attachment 'multi)
+ (mapcar #'car-safe candidates)))
(custom-dir (when ask-dir (read-directory-name
"Save to directory: "))))
;; we have determined what files to save, and where.