(mml-insert-mime): Don't break parts that mm-uu dissected.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 2 Mar 2009 23:27:36 +0000 (23:27 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 2 Mar 2009 23:27:36 +0000 (23:27 +0000)
lisp/ChangeLog
lisp/mml.el

index 9ae72c6..f96cd14 100644 (file)
@@ -1,3 +1,7 @@
+2009-03-02  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mml.el (mml-insert-mime): Don't break parts that mm-uu dissected.
+
 2009-02-27  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * lpath.el: Fbind rmail-swap-buffers-maybe for Emacs 21~22;
index e682b1b..6028ce8 100644 (file)
@@ -898,10 +898,17 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
       (unless (setq textp (equal (mm-handle-media-supertype handle) "text"))
        (save-excursion
          (set-buffer (setq buffer (mml-generate-new-buffer " *mml*")))
-         (mm-insert-part handle 'no-cache)
-         (if (setq mmlp (equal (mm-handle-media-type handle)
-                               "message/rfc822"))
-             (mime-to-mml)))))
+         (if (eq (mail-content-type-get (mm-handle-type handle) 'charset)
+                 'gnus-decoded)
+             ;; A part that mm-uu dissected from a non-MIME message
+             ;; because of `gnus-article-emulate-mime'.
+             (progn
+               (mm-enable-multibyte)
+               (insert-buffer-substring (mm-handle-buffer handle)))
+           (mm-insert-part handle 'no-cache)
+           (if (setq mmlp (equal (mm-handle-media-type handle)
+                                 "message/rfc822"))
+               (mime-to-mml))))))
     (if mmlp
        (mml-insert-mml-markup handle nil t t)
       (unless (and no-markup