emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog mail/rmail.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp ChangeLog mail/rmail.el
Date: Mon, 02 Mar 2009 08:03:44 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/03/02 08:03:43

Modified files:
        lisp           : ChangeLog 
        lisp/mail      : rmail.el 

Log message:
        (rmail-delete-headers): New function.
        (rmail-retry-failure): Restore yet another feature mbox Rmail removed
        without telling anyone, namely rmail-retry-ignored-headers.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15420&r2=1.15421
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmail.el?cvsroot=emacs&r1=1.519&r2=1.520

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15420
retrieving revision 1.15421
diff -u -b -r1.15420 -r1.15421
--- ChangeLog   2 Mar 2009 07:36:03 -0000       1.15420
+++ ChangeLog   2 Mar 2009 08:03:41 -0000       1.15421
@@ -10,6 +10,9 @@
        Doc fixes.
        (rmail-retry-failure): Use rmail-get-header rather than a magical
        save-excursion/restriction combination that does nothing.
+       (rmail-delete-headers): New function.
+       (rmail-retry-failure): Restore yet another feature mbox Rmail removed
+       without telling anyone, namely rmail-retry-ignored-headers.
 
 2009-03-01  Chong Yidong  <address@hidden>
 

Index: mail/rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.519
retrieving revision 1.520
diff -u -b -r1.519 -r1.520
--- mail/rmail.el       2 Mar 2009 07:36:06 -0000       1.519
+++ mail/rmail.el       2 Mar 2009 08:03:43 -0000       1.520
@@ -3625,6 +3625,25 @@
 (defvar mail-mime-unsent-header "^Content-Type: message/rfc822 *$"
  "A regexp that matches the header of a MIME body part with a failed message.")
 
+;; This is a cut-down version of rmail-clear-headers from Emacs 22.
+;; It doesn't have the same functionality, hence the name change.
+(defun rmail-delete-headers (regexp)
+  "Delete any mail headers matching REGEXP.
+The message should be narrowed to just the headers."
+  (when regexp
+    (goto-char (point-min))
+    (while (re-search-forward regexp nil t)
+      (beginning-of-line)
+      ;; This code from Emacs 22 doesn't seem right, since r-n-h is
+      ;; just for display.
+;;;      (if (looking-at rmail-nonignored-headers)
+;;;      (forward-line 1)
+      (delete-region (point)
+                    (save-excursion
+                      (if (re-search-forward "\n[^ \t]" nil t)
+                          (1- (point))
+                        (point-max)))))))
+
 (defun rmail-retry-failure ()
   "Edit a mail message which is based on the contents of the current message.
 For a message rejected by the mail system, extract the interesting headers and
@@ -3709,9 +3728,7 @@
          ;; Insert original text as initial text of new draft message.
          ;; Bind inhibit-read-only since the header delimiter
          ;; of the previous message was probably read-only.
-         (let ((inhibit-read-only t)
-               rmail-displayed-headers
-               rmail-ignored-headers)
+         (let ((inhibit-read-only t))
            (erase-buffer)
            (insert-buffer-substring rmail-this-buffer
                                     bounce-start bounce-end)
@@ -3721,6 +3738,8 @@
            (mail-sendmail-delimit-header)
            (save-restriction
              (narrow-to-region (point-min) (mail-header-end))
+             (rmail-delete-headers rmail-retry-ignored-headers)
+             (rmail-delete-headers "^\\(sender\\|return-path\\|received\\):")
              (setq resending (mail-fetch-field "resent-to"))
              (if mail-self-blind
                  (if resending




reply via email to

[Prev in Thread] Current Thread [Next in Thread]