From: morioka Date: Sun, 25 Oct 1998 10:01:51 +0000 (+0000) Subject: (mime-insert-header-from-buffer): Don't use `eword-decode-field-body' X-Git-Tag: flim-1_11_2~22 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edb7702f780e28147ec21337c1d2d1cdf6098a44;p=elisp%2Fflim.git (mime-insert-header-from-buffer): Don't use `eword-decode-field-body' to avoid overhead. --- diff --git a/mmgeneric.el b/mmgeneric.el index df62c4e..6d67b99 100644 --- a/mmgeneric.el +++ b/mmgeneric.el @@ -148,7 +148,7 @@ &optional invisible-fields visible-fields) (let ((the-buf (current-buffer)) - f-b p f-e field-name field field-body) + f-b p f-e field-name len field field-body) (save-excursion (set-buffer buffer) (save-restriction @@ -158,14 +158,25 @@ (setq f-b (match-beginning 0) p (match-end 0) field-name (buffer-substring f-b p) + len (string-width field-name) f-e (std11-field-end)) (when (mime-visible-field-p field-name visible-fields invisible-fields) - (setq field (buffer-substring f-b (1- p)) + (setq field (intern + (capitalize (buffer-substring f-b (1- p)))) field-body (buffer-substring p f-e)) (with-current-buffer the-buf (insert field-name) - (insert (eword-decode-field-body field field-body nil t)) + (insert + (if (memq field eword-decode-ignored-field-list) + ;; Don't decode + field-body + (if (memq field eword-decode-structured-field-list) + ;; Decode as structured field + (eword-decode-and-fold-structured-field field-body len) + ;; Decode as unstructured field + (eword-decode-unstructured-field-body field-body len) + ))) (insert "\n") )))))))