From: morioka Date: Thu, 28 May 1998 23:17:25 +0000 (+0000) Subject: (mime-text-insert-decoded-body): New function; abolish X-Git-Tag: remi-1_4_0_91~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f546bc36ce529a157d637059bae076e4c0743fbb;p=elisp%2Fsemi.git (mime-text-insert-decoded-body): New function; abolish 'mime-text-decode-body. (mime-preview-text/plain): Use 'mime-text-insert-decoded-body. (mime-preview-text/richtext): Use 'mime-text-insert-decoded-body. (mime-preview-text/enriched): Use 'mime-text-insert-decoded-body. --- diff --git a/mime-text.el b/mime-text.el index c90effd..8d3021f 100644 --- a/mime-text.el +++ b/mime-text.el @@ -64,8 +64,8 @@ See also variable `mime-charset-coding-system-alist'." (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 @@ -73,6 +73,9 @@ SITUATION. It must be symbol. 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)) @@ -135,10 +138,7 @@ local variable `mime-text-decoder' and variable (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") @@ -150,24 +150,18 @@ local variable `mime-text-decoder' and variable (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)) )))