(mime-text-decode-buffer charset)
))
-(defun mime-text-decode-body (situation)
- "Decode current buffer as text body.
+(defun mime-text-insert-decoded-body (entity situation)
+ "Insert text body of ENTITY in SITUATION.
It decodes MIME-encoding then code-converts as MIME-charset.
MIME-encoding is value of field 'encoding of SITUATION. It must be
'nil or string. MIME-charset is value of field \"charset\" of
This function calls text-decoder for MIME-charset specified by buffer
local variable `mime-text-decoder' and variable
`mime-text-decoder-alist'."
+ (insert-buffer-substring mime-raw-buffer
+ (mime-entity-body-start entity)
+ (mime-entity-body-end entity))
(let ((encoding (cdr (assq 'encoding situation))))
(mime-decode-region (point-min) (point-max) encoding)
(goto-char (point-min))
(defun mime-preview-text/plain (entity situation)
(save-restriction
(narrow-to-region (point-max)(point-max))
- (insert-buffer-substring mime-raw-buffer
- (mime-entity-body-start entity)
- (mime-entity-body-end entity))
- (mime-text-decode-body situation)
+ (mime-text-insert-decoded-body entity situation)
(goto-char (point-max))
(if (not (eq (char-after (1- (point))) ?\n))
(insert "\n")
(defun mime-preview-text/richtext (entity situation)
(save-restriction
(narrow-to-region (point-max)(point-max))
- (insert-buffer-substring mime-raw-buffer
- (mime-entity-body-start entity)
- (mime-entity-body-end entity))
+ (mime-text-insert-decoded-body entity situation)
(let ((beg (point-min)))
(remove-text-properties beg (point-max) '(face nil))
- (mime-text-decode-body situation)
(richtext-decode beg (point-max))
)))
(defun mime-preview-text/enriched (entity situation)
(save-restriction
(narrow-to-region (point-max)(point-max))
- (insert-buffer-substring mime-raw-buffer
- (mime-entity-body-start entity)
- (mime-entity-body-end entity))
+ (mime-text-insert-decoded-body entity situation)
(let ((beg (point-min)))
(remove-text-properties beg (point-max) '(face nil))
- (mime-text-decode-body situation)
(enriched-decode beg (point-max))
)))