* gnus-art.el (gnus-mime-display-single): Don't modify text if it has been
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 27 Sep 2005 02:16:37 +0000 (02:16 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 27 Sep 2005 02:16:37 +0000 (02:16 +0000)
 decoded.

* mm-decode.el (mm-automatic-display): Add text/verbatim.
(mm-insert-part): Don't modify text if it has been decoded.

* mm-uu.el (mm-uu-verbatim-marks-extract): Say text has been decoded.

* mm-view.el (mm-inline-text): Don't strip text props unless decoding enriched
 or richtext parts.

lisp/ChangeLog
lisp/gnus-art.el
lisp/mm-decode.el
lisp/mm-uu.el
lisp/mm-view.el

index 33ddc63..4f4e533 100644 (file)
@@ -1,3 +1,17 @@
+2005-09-27  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mime-display-single): Don't modify text if it
+       has been decoded.
+
+       * mm-decode.el (mm-automatic-display): Add text/verbatim.
+       (mm-insert-part): Don't modify text if it has been decoded.
+
+       * mm-uu.el (mm-uu-verbatim-marks-extract): Say text has been
+       decoded.
+
+       * mm-view.el (mm-inline-text): Don't strip text props unless
+       decoding enriched or richtext parts.
+
 2005-09-25  Romain Francoise  <romain@orebokech.com>
 
        * gnus-agent.el (gnus-agent-expire-group, gnus-agent-expire):
index 9533f58..ef67599 100644 (file)
@@ -5007,14 +5007,17 @@ If displaying \"text/html\" is discouraged \(see
              (forward-line -1)
              (setq beg (point)))
            (gnus-article-insert-newline)
-           (mm-insert-inline handle
-                             (let ((charset
-                                    (mail-content-type-get
-                                     (mm-handle-type handle) 'charset)))
-                               (if (eq charset 'gnus-decoded)
-                                   (mm-get-part handle)
-                                 (mm-decode-string (mm-get-part handle)
-                                                   charset))))
+           (mm-insert-inline
+            handle
+            (let ((charset (mail-content-type-get (mm-handle-type handle)
+                                                  'charset)))
+              (cond ((not charset)
+                     (mm-string-as-multibyte (mm-get-part handle)))
+                    ((eq charset 'gnus-decoded)
+                     (with-current-buffer (mm-handle-buffer handle)
+                       (buffer-string)))
+                    (t
+                     (mm-decode-string (mm-get-part handle) charset)))))
            (goto-char (point-max))))
          ;; Do highlighting.
          (save-excursion
index 18ec58a..6f6df66 100644 (file)
@@ -291,7 +291,7 @@ when selecting a different article."
   :group 'mime-display)
 
 (defcustom mm-automatic-display
-  '("text/plain" "text/enriched" "text/richtext" "text/html"
+  '("text/plain" "text/enriched" "text/richtext" "text/html" "text/verbatim"
     "text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*"
     "message/rfc822" "text/x-patch" "text/dns" "application/pgp-signature"
     "application/emacs-lisp" "application/x-emacs-lisp"
@@ -1051,10 +1051,16 @@ external if displayed external."
 
 (defun mm-insert-part (handle)
   "Insert the contents of HANDLE in the current buffer."
-  (save-excursion
-    (insert (if (mm-multibyte-p)
-               (mm-string-as-multibyte (mm-get-part handle))
-             (mm-get-part handle)))))
+  (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset)))
+    (save-excursion
+      (insert
+       (cond ((eq charset 'gnus-decoded)
+             (with-current-buffer (mm-handle-buffer handle)
+               (buffer-string)))
+            ((mm-multibyte-p)
+             (mm-string-as-multibyte (mm-get-part handle)))
+            (t
+             (mm-get-part handle)))))))
 
 (defun mm-file-name-delete-whitespace (file-name)
   "Remove all whitespace characters from FILE-NAME."
index 75b49c2..526f954 100644 (file)
@@ -289,7 +289,7 @@ apply the face `mm-uu-extract'."
     (progn (goto-char start-point) (forward-line) (point))
     (progn (goto-char end-point) (forward-line -1) (point))
     t)
-   '("text/verbatim")))
+   '("text/verbatim" (charset . gnus-decoded))))
 
 (defun mm-uu-emacs-sources-extract ()
   (mm-make-handle (mm-uu-copy-to-buffer start-point end-point)
index ed63669..1e02739 100644 (file)
        (goto-char (point-max))))
     (save-restriction
       (narrow-to-region b (point))
-      (set-text-properties (point-min) (point-max) nil)
       (when (or (equal type "enriched")
                (equal type "richtext"))
+       (set-text-properties (point-min) (point-max) nil)
        (ignore-errors
          (enriched-decode (point-min) (point-max))))
       (mm-handle-set-undisplayer