+ (set (make-local-variable 'rmail-old-mime-state)
+ (and rmail-enable-mime
+ ;; If you use something else, you are on your own.
+ (eq rmail-mime-feature 'rmailmm)
+ (rmail-mime-message-p)
+ (let ((entity (get-text-property (point-min) 'rmail-mime-entity)))
+ ;; rmailmm has got its hands on the message.
+ ;; Even if the message is in `raw' state, boundaries etc
+ ;; are still missing. All we can do is insert the real
+ ;; raw message. (Bug#9840)
+ ;; FIXME? Since the 2012-09-17 changes to rmail-mime,
+ ;; can we just use that function now?
+ (when (and entity
+ (not (equal "text/plain"
+ (car (rmail-mime-entity-type entity)))))
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (insert-buffer-substring
+ rmail-view-buffer
+ (aref (rmail-mime-entity-header entity) 0)
+ (aref (rmail-mime-entity-body entity) 1)))
+ (goto-char (point-min))
+ ;; t = decoded; raw = raw.
+ (aref (aref (rmail-mime-entity-display entity) 0) 0)))))