From: Katsumi Yamaoka Date: Mon, 10 May 2010 03:39:23 +0000 (+0000) Subject: Synch with Gnus trunk. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~211^2~32 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d8a7b2720048f6635a62873809169738728e629f;p=emacs.git Synch with Gnus trunk. (message-forward-make-body-plain, message-forward-make-body-mml): Don't use mm-with-unibyte-current-buffer. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d78e07037b4..65974c46124 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,4 +1,10 @@ -2010-05-07 Christian von Roques (tiny change) +2010-05-10 Katsumi Yamaoka + + * 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 (tiny change) * mml2015.el (mml2015-epg-find-usable-key): Skip disabled key (Bug#5592). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 79a88cd6bd3..788cb3fbe54 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7161,14 +7161,20 @@ Optional DIGEST will use digest to forward." (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 @@ Optional DIGEST will use digest to forward." (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)