Merge pull request #326 from DamienCassou/dialog-to-save-attachments
* better dialog to save attachments.
This commit is contained in:
@ -905,15 +905,27 @@ If ATTNUM is nil ask for the attachment number."
|
|||||||
(index (plist-get att :index))
|
(index (plist-get att :index))
|
||||||
(retry t) (fpath))
|
(retry t) (fpath))
|
||||||
(while retry
|
(while retry
|
||||||
(setq fpath (expand-file-name
|
(setq fpath (mu4e-view-request-attachment-path fname path))
|
||||||
(read-directory-name
|
|
||||||
(mu4e-format "Save as ") path nil nil fname)))
|
|
||||||
(setq retry
|
(setq retry
|
||||||
(and (file-exists-p fpath)
|
(and (file-exists-p fpath)
|
||||||
(not (y-or-n-p (mu4e-format "Overwrite '%s'?" fpath))))))
|
(not (y-or-n-p (mu4e-format "Overwrite '%s'?" fpath))))))
|
||||||
(mu4e~proc-extract
|
(mu4e~proc-extract
|
||||||
'save (mu4e-message-field msg :docid) index fpath)))
|
'save (mu4e-message-field msg :docid) index fpath)))
|
||||||
|
|
||||||
|
(defun mu4e-view-request-attachment-path (fname path)
|
||||||
|
"Ask the user where to save FNAME (default is PATH/FNAME)."
|
||||||
|
(let ((fpath (expand-file-name
|
||||||
|
(read-file-name
|
||||||
|
(mu4e-format "Save as ")
|
||||||
|
path
|
||||||
|
nil
|
||||||
|
nil
|
||||||
|
fname)
|
||||||
|
path)))
|
||||||
|
(if (file-directory-p fpath)
|
||||||
|
(expand-file-name fname fpath)
|
||||||
|
fpath)))
|
||||||
|
|
||||||
(defun mu4e-view-save-attachment-multi (&optional msg)
|
(defun mu4e-view-save-attachment-multi (&optional msg)
|
||||||
"Offer to save multiple email attachments from the current message.
|
"Offer to save multiple email attachments from the current message.
|
||||||
Default is to save all messages, [1..n], where n is the number of
|
Default is to save all messages, [1..n], where n is the number of
|
||||||
|
|||||||
Reference in New Issue
Block a user