changeset 102353:a2de015c936d

(rmail-reply): Use rmail-apply-in-message so that this function has access to all the headers, not just the visible ones.
author Glenn Morris <rgm@gnu.org>
date Mon, 02 Mar 2009 02:19:24 +0000
parents c61c29e47d6a
children 3206ad427d3c
files lisp/ChangeLog lisp/mail/rmail.el
diffstat 2 files changed, 34 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Mar 01 19:24:15 2009 +0000
+++ b/lisp/ChangeLog	Mon Mar 02 02:19:24 2009 +0000
@@ -1,3 +1,8 @@
+2009-03-02  Glenn Morris  <rgm@gnu.org>
+
+	* mail/rmail.el (rmail-reply): Use rmail-apply-in-message so that this
+	function has access to all the headers, not just the visible ones.
+
 2009-03-01  Chong Yidong  <cyd@stupidchicken.com>
 
 	* abbrev.el (clear-abbrev-table): Always return nil (Bug#2515).
--- a/lisp/mail/rmail.el	Sun Mar 01 19:24:15 2009 +0000
+++ b/lisp/mail/rmail.el	Mon Mar 02 02:19:24 2009 +0000
@@ -3300,45 +3300,35 @@
   (let (from reply-to cc subject date to message-id references
 	     resent-to resent-cc resent-reply-to
 	     (msgnum rmail-current-message))
-    (save-excursion
-      (save-restriction
-	(widen)
-	(if (rmail-buffers-swapped-p)
-	    (narrow-to-region
-	     (goto-char (point-min))
-	     (search-forward "\n\n" nil 'move))
-	  (goto-char (rmail-msgbeg rmail-current-message))
-	  (forward-line 1)
-	  (narrow-to-region
-	   (point)
-	   (search-forward "\n\n"
-			   (rmail-msgend rmail-current-message)
-			   'move)))
-	(setq from (mail-fetch-field "from")
-	      reply-to (or (mail-fetch-field "mail-reply-to" nil t)
-			   (mail-fetch-field "reply-to" nil t)
-			   from)
-	      subject (mail-fetch-field "subject")
-	      date (mail-fetch-field "date")
-	      message-id (mail-fetch-field "message-id")
-	      references (mail-fetch-field "references" nil nil t)
-	      resent-reply-to (mail-fetch-field "resent-reply-to" nil t)
-	      ;; Bug#512.  It's inappropriate to reply to these addresses.
-;;;	      resent-cc (and (not just-sender)
-;;;			     (mail-fetch-field "resent-cc" nil t))
-;;;	      resent-to (or (mail-fetch-field "resent-to" nil t) "")
-;;;	      resent-subject (mail-fetch-field "resent-subject")
-;;;	      resent-date (mail-fetch-field "resent-date")
-;;;	      resent-message-id (mail-fetch-field "resent-message-id")
-	      )
-	(unless just-sender
-	  (if (mail-fetch-field "mail-followup-to" nil t)
-	      ;; If this header field is present, use it instead of
-	      ;; the To and CC fields.
-	      (setq to (mail-fetch-field "mail-followup-to" nil t))
-	    (setq cc (or (mail-fetch-field "cc" nil t) "")
-		  to (or (mail-fetch-field "to" nil t) ""))))))
-
+    (rmail-apply-in-message
+     rmail-current-message
+     (lambda ()
+       (search-forward "\n\n" nil 'move)
+       (narrow-to-region (point-min) (point))
+       (setq from (mail-fetch-field "from")
+	     reply-to (or (mail-fetch-field "mail-reply-to" nil t)
+			  (mail-fetch-field "reply-to" nil t)
+			  from)
+	     subject (mail-fetch-field "subject")
+	     date (mail-fetch-field "date")
+	     message-id (mail-fetch-field "message-id")
+	     references (mail-fetch-field "references" nil nil t)
+	     resent-reply-to (mail-fetch-field "resent-reply-to" nil t)
+	     ;; Bug#512.  It's inappropriate to reply to these addresses.
+;;;	     resent-cc (and (not just-sender)
+;;;			    (mail-fetch-field "resent-cc" nil t))
+;;;	     resent-to (or (mail-fetch-field "resent-to" nil t) "")
+;;;	     resent-subject (mail-fetch-field "resent-subject")
+;;;	     resent-date (mail-fetch-field "resent-date")
+;;;	     resent-message-id (mail-fetch-field "resent-message-id")
+	     )
+       (unless just-sender
+	 (if (mail-fetch-field "mail-followup-to" nil t)
+	     ;; If this header field is present, use it instead of the
+	     ;; To and CC fields.
+	     (setq to (mail-fetch-field "mail-followup-to" nil t))
+	   (setq cc (or (mail-fetch-field "cc" nil t) "")
+		 to (or (mail-fetch-field "to" nil t) ""))))))
     ;; Merge the resent-to and resent-cc into the to and cc.
     ;; Bug#512.  It's inappropriate to reply to these addresses.
 ;;;    (if (and resent-to (not (equal resent-to "")))