mu4e/mu4e-view.el (mu4e-view-open-attachment): Ensure attachments are set

Before this change, I would press "o" and `mu4e~view-attach-map' would
be nil. Now it works as expected.
This commit is contained in:
Oleh Krehel
2018-11-18 16:21:06 +01:00
parent 7b6bccd49a
commit 6a8bbbd55f

View File

@ -1299,7 +1299,10 @@ ATTNUM is nil ask for the attachment number."
(interactive)
(let* ((msg (or msg (mu4e-message-at-point)))
(attnum (or attnum
(mu4e~view-get-attach-num "Attachment to open" msg)))
(progn
(unless mu4e~view-attach-map
(mu4e~view-construct-attachments-header msg))
(mu4e~view-get-attach-num "Attachment to open" msg))))
(att (or (mu4e~view-get-attach msg attnum)))
(index (plist-get att :index))
(docid (mu4e-message-field msg :docid))