From: morioka Date: Wed, 28 Oct 1998 22:27:48 +0000 (+0000) Subject: (mime-insert-header-from-buffer): Refer `mime-field-decoder-alist' X-Git-Tag: chao-1_12_0~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f1fc49bb9b23fa836b9cbf8c3829011ad8aa911;p=elisp%2Fflim.git (mime-insert-header-from-buffer): Refer `mime-field-decoder-alist' instead of hard-coding. --- diff --git a/mmgeneric.el b/mmgeneric.el index 6d67b99..9ae35db 100644 --- a/mmgeneric.el +++ b/mmgeneric.el @@ -148,6 +148,10 @@ &optional invisible-fields visible-fields) (let ((the-buf (current-buffer)) + (decoder-alist + (cdr (or (assq 'folding mime-field-decoder-alist) + (assq t mime-field-decoder-alist)))) + field-decoder f-b p f-e field-name len field field-body) (save-excursion (set-buffer buffer) @@ -164,19 +168,15 @@ visible-fields invisible-fields) (setq field (intern (capitalize (buffer-substring f-b (1- p)))) - field-body (buffer-substring p f-e)) + field-body (buffer-substring p f-e) + field-decoder (cdr (or (assq field decoder-alist) + (assq t decoder-alist)))) (with-current-buffer the-buf (insert field-name) - (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 (if field-decoder + (funcall field-decoder field-body len) + ;; Don't decode + field-body)) (insert "\n") )))))))