Mysterious `subject' bug work-around
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 15 Jul 2011 16:21:18 +0000 (18:21 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 15 Jul 2011 16:21:18 +0000 (18:21 +0200)
* message.el (message-reply): Work around mysterious bug where
`message-mode' seems to overwrite the locally bound `subject' variable.

lisp/ChangeLog
lisp/message.el

index 8e01c2f..5f95a6d 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-reply): Work around mysterious bug where
+       `message-mode' seems to overwrite the locally bound `subject' variable.
+
 2011-07-14  Andrew Cohen  <cohen@andy.bu.edu>
 
        * nnimap.el (nnimap-request-thread): Ensure search is performed in
index 5884c8e..0386b20 100644 (file)
@@ -6922,20 +6922,19 @@ Useful functions to put in this list include:
       (unless follow-to
        (setq follow-to (message-get-reply-headers wide to-address))))
 
-    (unless (message-mail-user-agent)
-      (message-pop-to-buffer
-       (message-buffer-name
-       (if wide "wide reply" "reply") from
-       (if wide to-address nil))
-       switch-function))
-
-    (setq message-reply-headers
-         (vector 0 subject from date message-id references 0 0 ""))
-
-    (message-setup
-     `((Subject . ,subject)
-       ,@follow-to)
-     cur)))
+    (let ((headers
+          `((Subject . ,subject)
+            ,@follow-to)))
+      (unless (message-mail-user-agent)
+       (message-pop-to-buffer
+        (message-buffer-name
+         (if wide "wide reply" "reply") from
+         (if wide to-address nil))
+        switch-function))
+      (setq message-reply-headers
+           (vector 0 (cdr (assq 'Subject headers))
+                   from date message-id references 0 0 ""))
+      (message-setup headers cur))))
 
 ;;;###autoload
 (defun message-wide-reply (&optional to-address)