mu4e-mime-parts: don't try to open non-files
When completion fails, don't try to open any files in mu4e-view-save-attachments.
This commit is contained in:
@ -297,13 +297,13 @@ does not have this limitation."
|
||||
(interactive "P")
|
||||
(let* ((parts (mu4e-view-mime-parts))
|
||||
(candidates (seq-map
|
||||
(lambda (fpart)
|
||||
(cons ;; (filename . annotation)
|
||||
(plist-get fpart :filename)
|
||||
fpart))
|
||||
(seq-filter
|
||||
(lambda (part) (plist-get part :attachment-like))
|
||||
parts)))
|
||||
(lambda (fpart)
|
||||
(cons ;; (filename . annotation)
|
||||
(plist-get fpart :filename)
|
||||
fpart))
|
||||
(seq-filter
|
||||
(lambda (part) (plist-get part :attachment-like))
|
||||
parts)))
|
||||
(candidates (or candidates
|
||||
(mu4e-warn "No attachments for this message")))
|
||||
(files (mu4e--completing-read "Save file(s): " candidates
|
||||
@ -316,8 +316,10 @@ does not have this limitation."
|
||||
(path (mu4e--uniqify-file-name
|
||||
(mu4e-join-paths
|
||||
(or custom-dir (plist-get part :target-dir))
|
||||
(plist-get part :filename)))))
|
||||
(mm-save-part-to-file (plist-get part :handle) path)))
|
||||
(plist-get part :filename))))
|
||||
(handle (plist-get part :handle)))
|
||||
(when handle ;; completion may fail, and then there's no handle.
|
||||
(mm-save-part-to-file handle path))))
|
||||
files)))
|
||||
|
||||
(defvar mu4e-view-mime-part-actions
|
||||
|
||||
Reference in New Issue
Block a user