diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-04 16:08:22 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-04 16:08:22 +0200 |
commit | 138060e3661470128a071d17a48671842f108343 (patch) | |
tree | ea77fb22b0c199e1b664c3d84f2ce691e7482e51 | |
parent | 4bf4002906fe60fda35c5ea725ffc0463ca4c26b (diff) | |
download | emacs-138060e3661470128a071d17a48671842f108343.tar.gz |
In Message, respect Content-Type provided by the user
* lisp/gnus/mml.el (mml-parse-1): Respect any Content-Type
inserted by the user instead of insisting on text/plain.
-rw-r--r-- | lisp/gnus/mml.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index b664ebe3bf9..4a0d40ac0ed 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -295,6 +295,14 @@ part. This is for the internal use, you should never modify the value.") (t (mm-find-mime-charset-region point (point) mm-hack-charsets)))) + ;; If the user has inserted a Content-Type header, then + ;; respect that instead of overwriting with "text/plain". + (save-restriction + (narrow-to-region point (point)) + (let ((content-type (mail-fetch-field "content-type"))) + (when (and content-type + (eq (car tag) 'part)) + (setcdr (assq 'type tag) content-type)))) (when (and (not raw) (memq nil charsets)) (if (or (memq 'unknown-encoding mml-confirmation-set) (message-options-get 'unknown-encoding) |