summaryrefslogtreecommitdiff
path: root/lisp/mail/rmailmm.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail/rmailmm.el')
-rw-r--r--lisp/mail/rmailmm.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 127fd8ac350..0bfeb121ca4 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -472,10 +472,11 @@ See `rmail-mime-entity' for the detail."
HEADER is a header component of a MIME-entity object (see
`rmail-mime-entity')."
(with-temp-buffer
- (let ((last-coding-system-used nil))
+ (let ((buf (current-buffer)))
(with-current-buffer rmail-mime-mbox-buffer
- (let ((rmail-buffer rmail-mime-mbox-buffer)
- (rmail-view-buffer rmail-mime-view-buffer))
+ (let ((last-coding-system-used nil)
+ (rmail-buffer rmail-mime-mbox-buffer)
+ (rmail-view-buffer buf))
(save-excursion
(goto-char (aref header 0))
(rmail-copy-headers (point) (aref header 1)))))
@@ -514,7 +515,9 @@ HEADER is a header component of a MIME-entity object (see
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region pos (point))))))
(decode-coding-region pos (point) coding-system)
- (if (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
+ (if (and
+ (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
+ (not (eq (coding-system-base coding-system) 'us-ascii)))
(setq rmail-mime-coding-system coding-system))
(or (bolp) (insert "\n"))))
@@ -1302,7 +1305,10 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
(rmail-mime-find-header-encoding
(rmail-mime-entity-header entity)))))
(set-buffer-file-coding-system
- (coding-system-base rmail-mime-coding-system) t t))
+ (if rmail-mime-coding-system
+ (coding-system-base rmail-mime-coding-system)
+ 'undecided)
+ t t))
;; Decoding failed. ENTITY is an error message. Insert the
;; original message body as is, and show warning.
(let ((region (with-current-buffer rmail-mime-mbox-buffer