changeset 110528:a4f29934ad86

Fix message-mode bug with fcc to Rmail buffers. * lisp/gnus/message.el (message-output): Use gnus-output-to-rmail if a buffer is visiting the fcc file in rmail-mode.
author Glenn Morris <rgm@gnu.org>
date Mon, 20 Sep 2010 20:11:34 -0700
parents 1c7c10a7b9ef
children 43a857ac456c
files lisp/gnus/ChangeLog lisp/gnus/message.el
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Mon Sep 20 20:07:49 2010 -0700
+++ b/lisp/gnus/ChangeLog	Mon Sep 20 20:11:34 2010 -0700
@@ -1,3 +1,8 @@
+2010-09-21  Glenn Morris  <rgm@gnu.org>
+
+	* message.el (message-output): Use gnus-output-to-rmail if a buffer is
+	visiting the fcc file in rmail-mode.
+
 2010-04-22  Andreas Seltenreich  <seltenreich@gmx.de>
 
 	* message.el (message-generate-headers): Record insertion of optional
--- a/lisp/gnus/message.el	Mon Sep 20 20:07:49 2010 -0700
+++ b/lisp/gnus/message.el	Mon Sep 20 20:11:34 2010 -0700
@@ -5311,8 +5311,14 @@
 
 (defun message-output (filename)
   "Append this article to Unix/babyl mail file FILENAME."
-  (if (and (file-readable-p filename)
-	   (mail-file-babyl-p filename))
+  (if (or (and (file-readable-p filename)
+	       (mail-file-babyl-p filename))
+	  ;; gnus-output-to-mail does the wrong thing with live, mbox
+	  ;; Rmail buffers in Emacs 23.
+	  ;; http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597255
+	  (let ((buff (find-buffer-visiting filename)))
+	    (and buff (with-current-buffer buff
+			(eq major-mode 'rmail-mode)))))
       (gnus-output-to-rmail filename t)
     (gnus-output-to-mail filename t)))