diff lisp/gnus/message.el @ 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 97594bf4e5a9
children b799d38f522a 376148b31b5e
line wrap: on
line diff
--- 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)))