(message-field-value): New function.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 18 Oct 2003 16:27:11 +0000 (16:27 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 18 Oct 2003 16:27:11 +0000 (16:27 +0000)
(message-insert-disposition-notification-to): Use Reply-To, too.

lisp/ChangeLog
lisp/message.el

index 7b716f5..8cea0df 100644 (file)
@@ -1,5 +1,8 @@
 2003-10-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * message.el (message-field-value): New function.
+       (message-insert-disposition-notification-to): Use Reply-To, too.
+
        * imap.el (imap-mailbox-status): Upcase STATUS commands. 
 
        * gnus-sum.el (gnus-remove-odd-characters): New function.
index f8090ee..41fdbda 100644 (file)
@@ -1564,6 +1564,13 @@ see `message-narrow-to-headers-or-head'."
       (set-text-properties 0 (length value) nil value)
       value)))
 
+(defun message-field-value (header &optional not-all)
+  "The same as `message-fetch-field', only narrow to the headers first."
+  (save-excursion
+    (save-restriction
+      (message-narrow-to-headers-or-head)
+      (message-fetch-field header not-all))))
+
 (defun message-narrow-to-field ()
   "Narrow the buffer to the header on the current line."
   (beginning-of-line)
@@ -2857,10 +2864,8 @@ Note that this should not be used in newsgroups."
       (message-remove-header "Disposition-Notification-To"))
     (message-goto-eoh)
     (insert (format "Disposition-Notification-To: %s\n"
-                   (or (save-excursion
-                         (save-restriction
-                           (message-narrow-to-headers)
-                           (message-fetch-field "From")))
+                   (or (message-field-value "Reply-to")
+                       (message-field-value "From")
                        (message-make-from))))))
 
 (defun message-elide-region (b e)