mu4e-view: ask to create directory when saving attachments

This commit is contained in:
Christian Schwarzgruber 2023-01-01 10:33:03 +01:00
parent 55added03b
commit 8db9e3edf2
1 changed files with 6 additions and 0 deletions

View File

@ -1146,6 +1146,12 @@ containing commas."
dir (if arg (read-directory-name "Save to directory: ")
mu4e-attachment-dir))
(cl-loop for (f . h) in handles
initially
do (when
(and
(not (file-directory-p dir))
(y-or-n-p (format "Create directory `%s'? " dir)))
(make-directory dir t))
when (member f files)
do (mm-save-part-to-file
h (let ((file (expand-file-name f dir)))