Commit 186f7f0b authored by Kenichi Handa's avatar Kenichi Handa

Enable display mode of MIME message in rmail.

parent e1a23575
......@@ -72,6 +72,27 @@ Bazaar recognizes the headers "Author", "Date" and "Fixes".
Git, Mercurial, and Monotone recognize "Author" and "Date".
Any unknown header is left as is in the message, so it is not lost.
** Rmail
** The default value of `rmail-enable-mime' is now t. Rmail decodes
MIME contents automatically. You can customize the variable
`rmail-enable-mime' back to `nil' to disable this automatic MIME
decoding.
** The command `rmail-mime' change the displaying of a MIME message
between decoded presentation form and raw data if `rmail-enable-mime'
is non-nil. And, with prefix argument, it change only the displaying
of the MIME entity at point.
** The new command TAB (rmail-mime-next-item) moves point to the next
item of MIME message.
** The new command backtab (rmail-mime-previous-item) moves point to
the previous item of MIME message.
** The new command RET (rmail-mime-toggle-hidden) hide or show the
body of the MIME entity at point.
** Obsolete packages
+++
......
2010-12-24 Kenichi Handa <handa@m17n.org>
* mail/rmailmm.el: New key bindings for rmail-mime-next-item,
rmail-mime-previous-item, and rmail-mime-toggle-hidden.
(rmail-mime-mbox-buffer)
(rmail-mime-view-buffer, rmail-mime-coding-system): New variables.
(rmail-mime-entity): Argument changed. All codes handling an
entity object are changed.
(rmail-mime-entity-header, rmail-mime-entity-body): Adjusted for
the above change.
(rmail-mime-entity-children, rmail-mime-entity-handler)
(rmail-mime-entity-tagline): New functions.
(rmail-mime-message-p): New function.
(rmail-mime-save): Bind rmail-mime-mbox-buffer.
(rmail-mime-entity-segment, rmail-mime-next-item)
(rmail-mime-previous-item, rmail-mime-shown-mode)
(rmail-mime-hidden-mode, rmail-mime-raw-mode)
(rmail-mime-toggle-raw, rmail-mime-toggle-hidden)
(rmail-mime-insert-tagline, rmail-mime-insert-header): New
functions.
(rmail-mime-text-handler): Call rmail-mime-insert-text.
(rmail-mime-insert-decoded-text): New function.
(rmail-mime-insert-text): Call rmail-mime-insert-decoded-text.
(rmail-mime-insert-image): Argument changed. Caller changed.
(rmail-mime-image): Call rmail-mime-toggle-hidden.
(rmail-mime-set-bulk-data): New funciton.
(rmail-mime-insert-bulk): Argument changed.
(rmail-mime-multipart-handler): Return t.
(rmail-mime-process-multipart): Argument changed. Handle
"multipart/alternative" here.
(rmail-mime-process): Argument changed.
(rmail-mime-parse): Bind rmail-mime-mbox-buffer.
(rmail-mime-insert): Argument changed. Handle raw display mode.
(rmail-mime): Argument changed. Handle toggling of raw display
mode.
(rmail-show-mime): Bind rmail-mime-mbox-buffer and
rmail-mime-view-buffer.
(rmail-insert-mime-forwarded-message): Likewise.
(rmail-search-mime-message): Likewise. Don't bind rmail-buffer.
* mail/rmail.el (rmail-show-message-1): If rmail-enable-mime is
non-nil, handle the header in rmail-show-mime-function.
2010-12-20 Leo <sdl.web@gmail.com>
* help-fns.el (describe-variable): Fix 2010-12-17 change.
......
......@@ -2691,75 +2691,72 @@ The current mail message becomes the message displayed."
(message "Showing message %d" msg))
(narrow-to-region beg end)
(goto-char beg)
(if (and rmail-enable-mime
(re-search-forward "mime-version: 1.0" nil t))
(let ((rmail-buffer mbox-buf)
(rmail-view-buffer view-buf))
(funcall rmail-show-mime-function))
(setq body-start (search-forward "\n\n" nil t))
(narrow-to-region beg (point))
(goto-char beg)
(save-excursion
(if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t)
(setq coding-system (intern (match-string 1)))
(setq coding-system (rmail-get-coding-system))))
(setq character-coding (mail-fetch-field "content-transfer-encoding")
is-text-message (rmail-is-text-p))
(if character-coding
(setq character-coding (downcase character-coding)))
(narrow-to-region beg end)
;; Decode the message body into an empty view buffer using a
;; unibyte temporary buffer where the character decoding takes
;; place.
(with-current-buffer rmail-view-buffer
(erase-buffer))
(if (null character-coding)
;; Do it directly since that is fast.
(rmail-decode-region body-start end coding-system view-buf)
;; Can this be done directly, skipping the temp buffer?
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-buffer-substring mbox-buf body-start end)
(cond
((string= character-coding "quoted-printable")
;; See bug#5441.
(or (mail-unquote-printable-region (point-min) (point-max)
nil t 'unibyte)
(message "Malformed MIME quoted-printable message")))
((and (string= character-coding "base64") is-text-message)
(condition-case err
(base64-decode-region (point-min) (point-max))
(error (message "%s" (cdr err)))))
((eq character-coding 'uuencode)
(error "uuencoded messages are not supported yet"))
(t))
(rmail-decode-region (point-min) (point-max)
coding-system view-buf))))
(with-current-buffer rmail-view-buffer
;; We give the view buffer a buffer-local value of
;; rmail-header-style based on the binding in effect when
;; this function is called; `rmail-toggle-headers' can
;; inspect this value to determine how to toggle.
(set (make-local-variable 'rmail-header-style) header-style)
;; Unquote quoted From lines
(goto-char (point-min))
(while (re-search-forward "^>+From " nil t)
(beginning-of-line)
(delete-char 1)
(forward-line))
(goto-char (point-min)))
;; Copy the headers to the front of the message view buffer.
(rmail-copy-headers beg end)
;; Add the separator (blank line) between headers and body;
(set (make-local-variable 'rmail-header-style) header-style))
(if (and rmail-enable-mime
(re-search-forward "mime-version: 1.0" nil t))
(let ((rmail-buffer mbox-buf)
(rmail-view-buffer view-buf))
(funcall rmail-show-mime-function))
(setq body-start (search-forward "\n\n" nil t))
(narrow-to-region beg (point))
(goto-char beg)
(save-excursion
(if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t)
(setq coding-system (intern (match-string 1)))
(setq coding-system (rmail-get-coding-system))))
(setq character-coding (mail-fetch-field "content-transfer-encoding")
is-text-message (rmail-is-text-p))
(if character-coding
(setq character-coding (downcase character-coding)))
(narrow-to-region beg end)
;; Decode the message body into an empty view buffer using a
;; unibyte temporary buffer where the character decoding takes
;; place.
(with-current-buffer rmail-view-buffer
(erase-buffer))
(if (null character-coding)
;; Do it directly since that is fast.
(rmail-decode-region body-start end coding-system view-buf)
;; Can this be done directly, skipping the temp buffer?
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-buffer-substring mbox-buf body-start end)
(cond
((string= character-coding "quoted-printable")
;; See bug#5441.
(or (mail-unquote-printable-region (point-min) (point-max)
nil t 'unibyte)
(message "Malformed MIME quoted-printable message")))
((and (string= character-coding "base64") is-text-message)
(condition-case err
(base64-decode-region (point-min) (point-max))
(error (message "%s" (cdr err)))))
((eq character-coding 'uuencode)
(error "uuencoded messages are not supported yet"))
(t))
(rmail-decode-region (point-min) (point-max)
coding-system view-buf)))
(with-current-buffer rmail-view-buffer
;; Prepare the separator (blank line) before the body.
(goto-char (point-min))
(insert "\n")
;; Unquote quoted From lines
(while (re-search-forward "^>+From " nil t)
(beginning-of-line)
(delete-char 1)
(forward-line))
(goto-char (point-min)))
;; Copy the headers to the front of the message view buffer.
(rmail-copy-headers beg end))
;; highlight the message, activate any URL like text and add
;; special highlighting for and quoted material.
(with-current-buffer rmail-view-buffer
(insert "\n")
(goto-char (point-min))
;; Decode the headers according to RFC2047.
(save-excursion
(search-forward "\n\n" nil 'move)
(rfc2047-decode-region (point-min) (point)))
(rmail-highlight-headers)
;(rmail-activate-urls)
;(rmail-process-quoted-material)
......@@ -4290,18 +4287,28 @@ With prefix argument N moves forward N messages with these labels.
;;;***
;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "222ca7c1e672a08e5799e5a72fb25049")
;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "faa9e26c7781c426785e671a040128ad")
;;; Generated autoloads from rmailmm.el
(autoload 'rmail-mime "rmailmm" "\
Process the current Rmail message as a MIME message.
This creates a temporary \"*RMAIL*\" buffer holding a decoded
copy of the message. Inline content-types are handled according to
Toggle displaying of a MIME message.
The actualy behavior depends on the value of `rmail-enable-mime'.
If `rmail-enable-mime' is t (default), this command change the
displaying of a MIME message between decoded presentation form
and raw data.
With ARG, toggle the displaying of the current MIME entity only.
If `rmail-enable-mime' is nil, this creates a temporary
\"*RMAIL*\" buffer holding a decoded copy of the message. Inline
content-types are handled according to
`rmail-mime-media-type-handlers-alist'. By default, this
displays text and multipart messages, and offers to download
attachments as specfied by `rmail-mime-attachment-dirs-alist'.
\(fn)" t nil)
\(fn &optional ARG)" t nil)
;;;***
......
......@@ -96,7 +96,9 @@ The first item is a regular expression matching a content-type.
The remaining elements are handler functions to run, in order of
decreasing preference. These are called until one returns non-nil.
Note that this only applies to items with an inline Content-Disposition,
all others are handled by `rmail-mime-bulk-handler'."
all others are handled by `rmail-mime-bulk-handler'.
Note also that this alist is ignored when the variable
`rmail-enable-mime' is non-nil."
:type '(alist :key-type regexp :value-type (repeat function))
:version "23.1"
:group 'rmail-mime)
......@@ -130,18 +132,36 @@ automatically display the image in the buffer."
;;; End of user options.
;;; Global variables that always have let-binding when referred.
(defvar rmail-mime-mbox-buffer nil
"Buffer containing the mbox data.
The value is usually nil, and bound to a proper value while
processing MIME.")
(defvar rmail-mime-view-buffer nil
"Buffer showing a message.
The value is usually nil, and bound to a proper value while
processing MIME.")
(defvar rmail-mime-coding-system nil
"The first coding-system used for decoding a MIME entity.
The value is usually nil, and bound to non-nil while inserting
MIME entities.")
;;; MIME-entity object
(defun rmail-mime-entity (type disposition transfer-encoding
header body children)
"Retrun a newly created MIME-entity object.
display header tagline body children handler)
"Retrun a newly created MIME-entity object from arguments.
A MIME-entity is a vector of 6 elements:
A MIME-entity is a vector of 9 elements:
[ TYPE DISPOSITION TRANSFER-ENCODING HEADER BODY CHILDREN ]
[TYPE DISPOSITION TRANSFER-ENCODING DISPLAY HEADER TAGLINE BODY
CHILDREN HANDLER]
TYPE and DISPOSITION correspond to MIME headers Content-Type: and
Cotent-Disposition: respectively, and has this format:
TYPE and DISPOSITION correspond to MIME headers Content-Type and
Cotent-Disposition respectively, and has this format:
\(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...)
......@@ -160,31 +180,61 @@ The corresponding TYPE argument must be:
TRANSFER-ENCODING corresponds to MIME header
Content-Transfer-Encoding, and is a lowercased string.
HEADER and BODY are a cons (BEG . END), where BEG and END specify
the region of the corresponding part in RMAIL's data (mbox)
buffer. BODY may be nil. In that case, the current buffer is
narrowed to the body part.
CHILDREN is a list of MIME-entities for a \"multipart\" entity, and
nil for the other types."
(vector type disposition transfer-encoding header body children))
DISPLAY is a vector [CURRENT NEW], where CURRENT indicates how
the header, tagline, and body of the entity are displayed now,
and NEW indicates how their displaying should be updated.
Both elements are vector [HEADER-DISPLAY TAGLINE-DISPLAY BODY-DISPLAY],
where each element is a symbol for the corresponding item that
has these values:
nil: not displayed
t: displayed by the decoded presentation form
raw: displayed by the raw MIME data (for the header and body only)
HEADER and BODY are vectors [BEG END DISPLAY-FLAG], where BEG and
END specify the region of the header or body lines in RMAIL's
data (mbox) buffer, and DISPLAY-FLAG non-nil means that the
header or body is, by default, displayed by the decoded
presentation form.
TAGLINE is a vector [TAG BULK-DATA DISPLAY-FLAG], where TAG is a
string indicating the depth and index number of the entity,
BULK-DATA is a cons (SIZE . TYPE) indicating the size and type of
an attached data, DISPLAY-FLAG non-nil means that the tagline is,
by default, displayed.
CHILDREN is a list of child MIME-entities. A \"multipart/*\"
entity have one or more children. A \"message/rfc822\" entity
has just one child. Any other entity has no child.
HANDLER is a function to insert the entity according to DISPLAY.
It is called with one argument ENTITY."
(vector type disposition transfer-encoding
display header tagline body children handler))
;; Accessors for a MIME-entity object.
(defsubst rmail-mime-entity-type (entity) (aref entity 0))
(defsubst rmail-mime-entity-disposition (entity) (aref entity 1))
(defsubst rmail-mime-entity-transfer-encoding (entity) (aref entity 2))
(defsubst rmail-mime-entity-header (entity) (aref entity 3))
(defsubst rmail-mime-entity-body (entity) (aref entity 4))
(defsubst rmail-mime-entity-children (entity) (aref entity 5))
(defsubst rmail-mime-entity-display (entity) (aref entity 3))
(defsubst rmail-mime-entity-header (entity) (aref entity 4))
(defsubst rmail-mime-entity-tagline (entity) (aref entity 5))
(defsubst rmail-mime-entity-body (entity) (aref entity 6))
(defsubst rmail-mime-entity-children (entity) (aref entity 7))
(defsubst rmail-mime-entity-handler (entity) (aref entity 8))
(defsubst rmail-mime-message-p ()
"Non-nil if and only if the current message is a MIME."
(or (get-text-property (point) 'rmail-mime-entity)
(get-text-property (point-min) 'rmail-mime-entity)))
;;; Buttons
(defun rmail-mime-save (button)
"Save the attachment using info in the BUTTON."
(let* ((filename (button-get button 'filename))
(let* ((rmail-mime-mbox-buffer rmail-view-buffer)
(filename (button-get button 'filename))
(directory (button-get button 'directory))
(data (button-get button 'data))
(mbox-buf rmail-view-buffer)
(ofilename filename))
(setq filename (expand-file-name
(read-file-name (format "Save as (default: %s): " filename)
......@@ -209,7 +259,8 @@ nil for the other types."
;; DATA is a MIME-entity object.
(let ((transfer-encoding (rmail-mime-entity-transfer-encoding data))
(body (rmail-mime-entity-body data)))
(insert-buffer-substring mbox-buf (car body) (cdr body))
(insert-buffer-substring rmail-mime-mbox-buffer
(aref body 0) (aref body 1))
(cond ((string= transfer-encoding "base64")
(ignore-errors (base64-decode-region (point-min) (point-max))))
((string= transfer-encoding "quoted-printable")
......@@ -218,34 +269,293 @@ nil for the other types."
(define-button-type 'rmail-mime-save 'action 'rmail-mime-save)
(defun rmail-mime-entity-segment (pos &optional entity)
"Return a vector describing the displayed region of a MIME-entity at POS.
Optional 2nd argument ENTITY is the MIME-entity at POS.
The value is a vector [ INDEX HEADER TAGLINE BODY END], where
HEADER: the position of the beginning of a header
TAGLINE: the position of the beginning of a tagline
BODY: the position of the beginning of a body
END: the position of the end of the entity.
INDEX: index into the returned vector indicating where POS is."
(save-excursion
(or entity
(setq entity (get-text-property pos 'rmail-mime-entity)))
(if (not entity)
(vector 1 (point) (point) (point) (point))
(let ((current (aref (rmail-mime-entity-display entity) 0))
(beg (if (and (> pos (point-min))
(eq (get-text-property (1- pos) 'rmail-mime-entity)
entity))
(previous-single-property-change pos 'rmail-mime-entity
nil (point-min))
pos))
(index 1)
tagline-beg body-beg end)
(goto-char beg)
(if (aref current 0)
(search-forward "\n\n" nil t))
(setq tagline-beg (point))
(if (>= pos tagline-beg)
(setq index 2))
(if (aref current 1)
(forward-line 1))
(setq body-beg (point))
(if (>= pos body-beg)
(setq index 3))
(if (aref current 2)
(let ((tag (aref (rmail-mime-entity-tagline entity) 0))
tag2)
(setq end (next-single-property-change beg 'rmail-mime-entity
nil (point-max)))
(while (and (< end (point-max))
(setq entity (get-text-property end 'rmail-mime-entity)
tag2 (aref (rmail-mime-entity-tagline entity) 0))
(and (> (length tag2) 0)
(eq (string-match tag tag2) 0)))
(setq end (next-single-property-change end 'rmail-mime-entity
nil (point-max)))))
(setq end body-beg))
(vector index beg tagline-beg body-beg end)))))
(defun rmail-mime-next-item ()
"Move point to the next displayed item of the current MIME entity.
A MIME entity has three items; header, tagline, and body.
If we are in the last item of the entity, move point to the first
item of the next entity. If we reach the end of buffer, move
point to the first item of the first entity (i.e. the beginning
of buffer)."
(interactive)
(if (rmail-mime-message-p)
(let* ((segment (rmail-mime-entity-segment (point)))
(next-pos (aref segment (1+ (aref segment 0))))
(button (next-button (point))))
(goto-char (if (and button (< (button-start button) next-pos))
(button-start button)
next-pos))
(if (eobp)
(goto-char (point-min))))))
(defun rmail-mime-previous-item ()
"Move point to the previous displayed item of the current MIME message.
A MIME entity has three items; header, tagline, and body.
If we are at the beginning of the first item of the entity, move
point to the last item of the previous entity. If we reach the
beginning of buffer, move point to the last item of the last
entity."
(interactive)
(when (rmail-mime-message-p)
(if (bobp)
(goto-char (point-max)))
(let* ((segment (rmail-mime-entity-segment (1- (point))))
(prev-pos (aref segment (aref segment 0)))
(button (previous-button (point))))
(goto-char (if (and button (> (button-start button) prev-pos))
(button-start button)
prev-pos)))))
(defun rmail-mime-shown-mode (entity)
"Make MIME-entity ENTITY displayed by the default way."
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 (aref (rmail-mime-entity-header entity) 2))
(aset new 1 (aref (rmail-mime-entity-tagline entity) 2))
(aset new 2 (aref (rmail-mime-entity-body entity) 2))))
(defun rmail-mime-hidden-mode (entity top)
"Make MIME-entity ENTITY displayed in the hidden mode.
If TOP is non-nil, display ENTITY only by the tagline.
Otherwise, don't display ENTITY."
(if top
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 nil)
(aset new 1 top)
(aset new 2 nil)
(aset (rmail-mime-entity-body entity) 2 nil))
(let ((current (aref (rmail-mime-entity-display entity) 0)))
(aset current 0 nil)
(aset current 1 nil)
(aset current 2 nil)))
(dolist (child (rmail-mime-entity-children entity))
(rmail-mime-hidden-mode child nil)))
(defun rmail-mime-raw-mode (entity)
"Make MIME-entity ENTITY displayed in the raw mode."
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 'raw)
(aset new 1 nil)
(aset new 2 'raw)
(dolist (child (rmail-mime-entity-children entity))
(rmail-mime-hidden-mode child nil))))
(defun rmail-mime-toggle-raw (entity)
"Toggle on and off the raw display mode of MIME-entity ENTITY."
(let* ((pos (if (eobp) (1- (point-max)) (point)))
(entity (get-text-property pos 'rmail-mime-entity))
(current (aref (rmail-mime-entity-display entity) 0))
(segment (rmail-mime-entity-segment pos entity)))
(if (not (eq (aref current 0) 'raw))
;; Enter the raw mode.
(rmail-mime-raw-mode entity)
;; Enter the shown mode.
(rmail-mime-shown-mode entity))
(let ((inhibit-read-only t)
(modified (buffer-modified-p)))
(save-excursion
(goto-char (aref segment 1))
(rmail-mime-insert entity)
(restore-buffer-modified-p modified)))))
(defun rmail-mime-toggle-hidden ()
"Toggle on and off the hidden display mode of MIME-entity ENTITY."
(interactive)
(when (rmail-mime-message-p)
(let* ((rmail-mime-mbox-buffer rmail-view-buffer)
(rmail-mime-view-buffer (current-buffer))
(pos (if (eobp) (1- (point-max)) (point)))
(entity (get-text-property pos 'rmail-mime-entity))
(current (aref (rmail-mime-entity-display entity) 0))
(segment (rmail-mime-entity-segment pos entity)))
(if (aref current 2)
;; Enter the hidden mode.
(progn
;; If point is in the body part, move it to the tagline
;; (or the header if headline is not displayed).
(if (= (aref segment 0) 3)
(goto-char (aref segment 2)))
(rmail-mime-hidden-mode entity t)
;; If the current entity is the topmost one, display the
;; header.
(if (and rmail-mime-mbox-buffer (= (aref segment 1) (point-min)))
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 t))))
;; Enter the shown mode.
(aset (rmail-mime-entity-body entity) 2 t)
(rmail-mime-shown-mode entity))
(let ((inhibit-read-only t)
(modified (buffer-modified-p))
(rmail-mime-mbox-buffer rmail-view-buffer)
(rmail-mime-view-buffer rmail-buffer))
(save-excursion
(goto-char (aref segment 1))
(rmail-mime-insert entity)
(restore-buffer-modified-p modified))))))
(define-key rmail-mode-map "\t" 'rmail-mime-next-item)
(define-key rmail-mode-map [backtab] 'rmail-mime-previous-item)
(define-key rmail-mode-map "\r" 'rmail-mime-toggle-hidden)
;;; Handlers
(defun rmail-mime-insert-tagline (entity &rest item-list)
"Insert a tag line for MIME-entity ENTITY.
ITEM-LIST is a list of strings or button-elements (list) to be added
to the tag line."
(insert "[")
(let ((tag (aref (rmail-mime-entity-tagline entity) 0)))
(if (> (length tag) 0) (insert (substring tag 1) ":")))
(insert (car (rmail-mime-entity-type entity)))
(dolist (item item-list)
(when item
(if (stringp item)
(insert item)
(apply 'insert-button item))))
(insert "]\n"))
(defun rmail-mime-insert-header (header)
"Decode and insert a MIME-entity header HEADER in the current buffer.
HEADER is a vector [BEG END DEFAULT-STATUS].
See `rmail-mime-entity' for the detail."
(let ((pos (point))
(last-coding-system-used nil))
(save-restriction
(narrow-to-region pos pos)
(with-current-buffer rmail-mime-mbox-buffer
(let ((rmail-buffer rmail-mime-mbox-buffer)
(rmail-view-buffer rmail-mime-view-buffer))
(save-excursion
(goto-char (aref header 0))
(rmail-copy-headers (point) (aref header 1)))))
(rfc2047-decode-region pos (point))
(if (and last-coding-system-used (not rmail-mime-coding-system))
(setq rmail-mime-coding-system last-coding-system-used))
(goto-char (point-min))
(rmail-highlight-headers)
(goto-char (point-max))
(insert "\n"))))
(defun rmail-mime-text-handler (content-type
content-disposition
content-transfer-encoding)
"Handle the current buffer as a plain text MIME part."
(let* ((charset (cdr (assq 'charset (cdr content-type))))
(coding-system (when charset
(intern (downcase charset)))))
(when (coding-system-p coding-system)
(decode-coding-region (point-min) (point-max) coding-system))))
(defun rmail-mime-insert-text (entity)
"Insert MIME-entity ENTITY as a plain text MIME part in the current buffer."
(rmail-mime-insert-text
(rmail-mime-entity content-type content-disposition
content-transfer-encoding
(vector (vector nil nil nil) (vector nil nil t))
(vector nil nil nil) (vector "" (cons nil nil) t)
(vector nil nil nil) nil 'rmail-mime-insert-text))
t)
(defun rmail-mime-insert-decoded-text (entity)
"Decode and insert the text body of MIME-entity ENTITY."
(let* ((content-type (rmail-mime-entity-type entity))
(charset (cdr (assq 'charset (cdr content-type))))
(coding-system (if charset (intern (downcase charset))))
(transfer-encoding (rmail-mime-entity-transfer-encoding entity))