(insert-header): Include `:' in field-name.
authormorioka <morioka>
Mon, 19 Oct 1998 18:44:53 +0000 (18:44 +0000)
committermorioka <morioka>
Mon, 19 Oct 1998 18:44:53 +0000 (18:44 +0000)
mmgeneric.el

index 634c80a..e6062e9 100644 (file)
     (let ((the-buf (current-buffer))
          (src-buf (mime-entity-buffer entity))
          (h-end (mime-entity-header-end-internal entity))
-         beg p end field-name len field)
+         beg p end field-name len field field-body)
       (save-excursion
        (set-buffer src-buf)
        (goto-char (mime-entity-header-start-internal entity))
          (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))
+                 field-name (buffer-substring beg p)
                  len (string-width field-name)
                  end (std11-field-end))
            (when (mime-visible-field-p field-name
                                        visible-fields invisible-fields)
-             (setq field (intern (capitalize field-name)))
-             (save-excursion
-               (set-buffer the-buf)
+             (setq field (intern
+                          (capitalize (buffer-substring beg (1- p))))
+                   field-body (buffer-substring p end))
+             (with-current-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)
+               (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
-                      (let ((body (save-excursion
-                                    (set-buffer src-buf)
-                                    (buffer-substring p end)
-                                    )))
-                        (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)
-                                    )))
-                        (insert (eword-decode-unstructured-field-body
-                                 body (1+ len)))
-                        )))
+                      (eword-decode-and-fold-structured-field field-body len)
+                    ;; Decode as unstructured field
+                    (eword-decode-unstructured-field-body field-body len)
+                    )))
                (insert "\n")
                ))))))))