]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-reply): Use rmail-apply-in-message so that this function has
authorGlenn Morris <rgm@gnu.org>
Mon, 2 Mar 2009 02:19:24 +0000 (02:19 +0000)
committerGlenn Morris <rgm@gnu.org>
Mon, 2 Mar 2009 02:19:24 +0000 (02:19 +0000)
access to all the headers, not just the visible ones.

lisp/ChangeLog
lisp/mail/rmail.el

index 02c15a5ddcfbbe12b8ee284eade9a2b4e3262e38..87490752f3f63c002c6907d1c118bb5dee013c57 100644 (file)
@@ -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).
index 5831fd793aede709dca440e63cd99366200d16a7..101283f29d6f5df9b718b9170e0fcd699ab78537 100644 (file)
@@ -3300,45 +3300,35 @@ use \\[mail-yank-original] to yank the original message into it."
   (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 "")))