(mime-insert-decoded-header): Use implementation of mm-backend;
authormorioka <morioka>
Wed, 1 Jul 1998 05:59:30 +0000 (05:59 +0000)
committermorioka <morioka>
Wed, 1 Jul 1998 05:59:30 +0000 (05:59 +0000)
abolish optional argument `code-conversion'.

mime.el

diff --git a/mime.el b/mime.el
index cc3ef20..9672dd8 100644 (file)
--- a/mime.el
+++ b/mime.el
@@ -288,63 +288,11 @@ ENTITY is used."
          )
        t)))
 
-(defun mime-insert-decoded-header (entity
-                                  &optional invisible-fields visible-fields
-                                  code-conversion)
+(defun mime-insert-decoded-header (entity &optional invisible-fields
+                                         visible-fields)
   "Insert before point a decoded header of ENTITY."
-  (let ((default-charset
-         (if code-conversion
-             (if (mime-charset-to-coding-system code-conversion)
-                 code-conversion
-               default-mime-charset))))
-    (save-restriction
-      (narrow-to-region (point)(point))
-      (let ((the-buf (current-buffer))
-           (src-buf (mime-entity-buffer entity))
-           (h-end (mime-entity-header-end entity))
-           beg p end field-name len field)
-       (save-excursion
-         (set-buffer src-buf)
-         (goto-char (mime-entity-header-start entity))
-         (save-restriction
-           (narrow-to-region (point) h-end)
-           (while (re-search-forward std11-field-head-regexp nil t)
-             (setq beg (match-beginning 0)
-                   p (match-end 0)
-                   field-name (buffer-substring beg (1- p))
-                   len (string-width field-name)
-                   end (std11-field-end))
-             (when (eword-visible-field-p field-name
-                                          visible-fields invisible-fields)
-               (setq field (intern (capitalize field-name)))
-               (save-excursion
-                 (set-buffer the-buf)
-                 (insert field-name)
-                 (insert ":")
-                 (cond ((memq field eword-decode-ignored-field-list)
-                        ;; Don't decode
-                        (insert-buffer-substring src-buf p end)
-                        )
-                       ((memq field eword-decode-structured-field-list)
-                        ;; Decode as structured field
-                        (let ((body (save-excursion
-                                      (set-buffer src-buf)
-                                      (buffer-substring p end)))
-                              (default-mime-charset default-charset))
-                          (insert (eword-decode-and-fold-structured-field
-                                   body (1+ len)))
-                          ))
-                       (t
-                        ;; Decode as unstructured field
-                        (let ((body (save-excursion
-                                      (set-buffer src-buf)
-                                      (buffer-substring p end)))
-                              (default-mime-charset default-charset))
-                          (insert (eword-decode-unstructured-field-body
-                                   body (1+ len)))
-                          )))
-                 (insert "\n")
-                 )))))))))
+  (mime-entity-send entity 'insert-decoded-header
+                   invisible-fields visible-fields))
 
 
 ;;; @ Entity Attributes