summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
29762dd)
Notmuch puts attachments in as declared content-type except when the
content-type is application/octet-stream it tries to guess the type
from the filename/extension. This means that viewing a pdf (for
example) which is sent as application/octet-strem invokes the pdf
viewer rather than just offering to save the part.
Recent changes to the attachment handling (commit
1546387d) changed
(broke) this. This patch stores the calculated mime-type with the part
and changes the attachment part handlers can use it instead.
(notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
(content-beg (point)))
(notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
(content-beg (point)))
+ ;; Store the computed mime-type for later use (e.g. by attachment handlers).
+ (plist-put part :computed-type mime-type)
+
(if (not hide)
(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
(button-put button :notmuch-lazy-part
(if (not hide)
(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
(button-put button :notmuch-lazy-part
(message-id (notmuch-show-get-message-id))
(nth (plist-get part :id))
(buf (notmuch-show-generate-part-buffer message-id nth))
(message-id (notmuch-show-get-message-id))
(nth (plist-get part :id))
(buf (notmuch-show-generate-part-buffer message-id nth))
- (content-type (plist-get part :content-type))
+ (computed-type (plist-get part :computed-type))
(filename (plist-get part :filename))
(disposition (if filename `(attachment (filename . ,filename)))))
(filename (plist-get part :filename))
(disposition (if filename `(attachment (filename . ,filename)))))
- (mm-make-handle buf (list content-type) nil nil disposition)))
+ (mm-make-handle buf (list computed-type) nil nil disposition)))
(defun notmuch-show-apply-to-current-part-handle (fn)
"Apply FN to an mm-handle for the part containing point.
(defun notmuch-show-apply-to-current-part-handle (fn)
"Apply FN to an mm-handle for the part containing point.