changeset 108389:3103a7f3cca6

Synch with Gnus trunk. (message-forward-make-body-plain, message-forward-make-body-mml): Don't use mm-with-unibyte-current-buffer.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 10 May 2010 03:40:12 +0000
parents 0ce7b05a8161 (current diff) c8dacd2579e6 (diff)
children 1582267d4b39 7642d075642b
files
diffstat 2 files changed, 37 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Sun May 09 19:21:42 2010 -0700
+++ b/lisp/gnus/ChangeLog	Mon May 10 03:40:12 2010 +0000
@@ -1,4 +1,10 @@
-2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+2010-05-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* message.el (message-forward-make-body-plain)
+	(message-forward-make-body-mml):
+	Don't use mm-with-unibyte-current-buffer.
+
+2010-05-07  Christian von Roques  <roques@mti.ag>  (tiny change)
 
 	* mml2015.el (mml2015-epg-find-usable-key): Skip disabled key
 	(Bug#5592).
--- a/lisp/gnus/message.el	Sun May 09 19:21:42 2010 -0700
+++ b/lisp/gnus/message.el	Mon May 10 03:40:12 2010 +0000
@@ -7161,14 +7161,20 @@
 (defun message-forward-make-body-plain (forward-buffer)
   (insert
    "\n-------------------- Start of forwarded message --------------------\n")
-  (let ((b (point)) e)
+  (let ((b (point))
+	contents multibyte-p e)
+    (with-current-buffer forward-buffer
+      (setq contents (buffer-string)
+	    multibyte-p (mm-multibyte-p)))
     (insert
      (with-temp-buffer
-       (mm-disable-multibyte)
-       (insert
-	(with-current-buffer forward-buffer
-	  (mm-with-unibyte-current-buffer (buffer-string))))
-       (mm-enable-multibyte)
+       (if multibyte-p
+	   (progn
+	     (mm-enable-multibyte)
+	     (insert contents))
+	 (mm-disable-multibyte)
+	 (insert contents)
+	 (mm-enable-multibyte))
        (mime-to-mml)
        (goto-char (point-min))
        (when (looking-at "From ")
@@ -7212,18 +7218,24 @@
   (insert "\n\n<#mml type=message/rfc822 disposition=inline>\n")
   (let ((b (point)) e)
     (if (not message-forward-decoded-p)
-	(insert
-	 (with-temp-buffer
-	   (mm-disable-multibyte)
-	   (insert
-	    (with-current-buffer forward-buffer
-	      (mm-with-unibyte-current-buffer (buffer-string))))
-	   (mm-enable-multibyte)
-	   (mime-to-mml)
-	   (goto-char (point-min))
-	   (when (looking-at "From ")
-	     (replace-match "X-From-Line: "))
-	   (buffer-string)))
+	(let (contents multibyte-p)
+	  (with-current-buffer forward-buffer
+	    (setq contents (buffer-string)
+		  multibyte-p (mm-multibyte-p)))
+	  (insert
+	   (with-temp-buffer
+	     (if multibyte-p
+		 (progn
+		   (mm-enable-multibyte)
+		   (insert contents))
+	       (mm-disable-multibyte)
+	       (insert contents)
+	       (mm-enable-multibyte))
+	     (mime-to-mml)
+	     (goto-char (point-min))
+	     (when (looking-at "From ")
+	       (replace-match "X-From-Line: "))
+	     (buffer-string))))
       (save-restriction
 	(narrow-to-region (point) (point))
 	(mml-insert-buffer forward-buffer)