(mime-insert-header-from-buffer): Refer `mime-field-decoder-alist'
authormorioka <morioka>
Wed, 28 Oct 1998 22:27:48 +0000 (22:27 +0000)
committermorioka <morioka>
Wed, 28 Oct 1998 22:27:48 +0000 (22:27 +0000)
instead of hard-coding.

mmgeneric.el

index 6d67b99..9ae35db 100644 (file)
                                              &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)
                                      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")
              )))))))