From: Katsumi Yamaoka Date: Wed, 12 May 2010 02:09:58 +0000 (+0000) Subject: Synch with Gnus trunk. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~211^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8b320e66d6e6d549ab445b7083d44e4b8a71319a;p=emacs.git Synch with Gnus trunk. (message-forward-make-body-mml): Assume original message is multibyte string; error on unibyte. (message-forward-make-body-plain): Ditto; don't add excessive newline in body end. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 97cbb0ca8fe..194d2036c3f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2010-05-12 Katsumi Yamaoka + + * message.el (message-forward-make-body-mml): Assume original message + is multibyte string; error on unibyte. + (message-forward-make-body-plain): Ditto; don't add excessive newline + in body end. + 2010-05-11 Andreas Seltenreich * gnus-sum.el (gnus-summary-kill-thread): Use gnus-summary-mark-article diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 788cb3fbe54..897fe695288 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7162,27 +7162,27 @@ Optional DIGEST will use digest to forward." (insert "\n-------------------- Start of forwarded message --------------------\n") (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 - (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))) + (contents (with-current-buffer forward-buffer (buffer-string))) + e) + (unless (featurep 'xemacs) + (unless (multibyte-string-p contents) + (error "Attempt to insert unibyte string from the buffer \"%s\"\ + to the multibyte buffer \"%s\"" + (if (bufferp forward-buffer) + (buffer-name forward-buffer) + forward-buffer) + (buffer-name)))) + (insert (mm-with-multibyte-buffer + (insert contents) + (mime-to-mml) + (goto-char (point-min)) + (when (looking-at "From ") + (replace-match "X-From-Line: ")) + (buffer-string))) + (unless (bolp) (insert "\n")) (setq e (point)) (insert - "\n-------------------- End of forwarded message --------------------\n") + "-------------------- End of forwarded message --------------------\n") (message-remove-ignored-headers b e))) (defun message-remove-ignored-headers (b e) @@ -7218,24 +7218,22 @@ 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) - (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)))) + (let ((contents (with-current-buffer forward-buffer (buffer-string)))) + (unless (featurep 'xemacs) + (unless (multibyte-string-p contents) + (error "Attempt to insert unibyte string from the buffer \"%s\"\ + to the multibyte buffer \"%s\"" + (if (bufferp forward-buffer) + (buffer-name forward-buffer) + forward-buffer) + (buffer-name)))) + (insert (mm-with-multibyte-buffer + (insert contents) + (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)