aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/mail/rmail.el25
2 files changed, 25 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 18526ec650c..1dda3a53f48 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -10,6 +10,9 @@
10 Doc fixes. 10 Doc fixes.
11 (rmail-retry-failure): Use rmail-get-header rather than a magical 11 (rmail-retry-failure): Use rmail-get-header rather than a magical
12 save-excursion/restriction combination that does nothing. 12 save-excursion/restriction combination that does nothing.
13 (rmail-delete-headers): New function.
14 (rmail-retry-failure): Restore yet another feature mbox Rmail removed
15 without telling anyone, namely rmail-retry-ignored-headers.
13 16
142009-03-01 Chong Yidong <cyd@stupidchicken.com> 172009-03-01 Chong Yidong <cyd@stupidchicken.com>
15 18
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 30cd9c092ff..dbd4fcf75af 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3625,6 +3625,25 @@ typically for purposes of moderating a list."
3625(defvar mail-mime-unsent-header "^Content-Type: message/rfc822 *$" 3625(defvar mail-mime-unsent-header "^Content-Type: message/rfc822 *$"
3626 "A regexp that matches the header of a MIME body part with a failed message.") 3626 "A regexp that matches the header of a MIME body part with a failed message.")
3627 3627
3628;; This is a cut-down version of rmail-clear-headers from Emacs 22.
3629;; It doesn't have the same functionality, hence the name change.
3630(defun rmail-delete-headers (regexp)
3631 "Delete any mail headers matching REGEXP.
3632The message should be narrowed to just the headers."
3633 (when regexp
3634 (goto-char (point-min))
3635 (while (re-search-forward regexp nil t)
3636 (beginning-of-line)
3637 ;; This code from Emacs 22 doesn't seem right, since r-n-h is
3638 ;; just for display.
3639;;; (if (looking-at rmail-nonignored-headers)
3640;;; (forward-line 1)
3641 (delete-region (point)
3642 (save-excursion
3643 (if (re-search-forward "\n[^ \t]" nil t)
3644 (1- (point))
3645 (point-max)))))))
3646
3628(defun rmail-retry-failure () 3647(defun rmail-retry-failure ()
3629 "Edit a mail message which is based on the contents of the current message. 3648 "Edit a mail message which is based on the contents of the current message.
3630For a message rejected by the mail system, extract the interesting headers and 3649For a message rejected by the mail system, extract the interesting headers and
@@ -3709,9 +3728,7 @@ specifying headers which should not be copied into the new message."
3709 ;; Insert original text as initial text of new draft message. 3728 ;; Insert original text as initial text of new draft message.
3710 ;; Bind inhibit-read-only since the header delimiter 3729 ;; Bind inhibit-read-only since the header delimiter
3711 ;; of the previous message was probably read-only. 3730 ;; of the previous message was probably read-only.
3712 (let ((inhibit-read-only t) 3731 (let ((inhibit-read-only t))
3713 rmail-displayed-headers
3714 rmail-ignored-headers)
3715 (erase-buffer) 3732 (erase-buffer)
3716 (insert-buffer-substring rmail-this-buffer 3733 (insert-buffer-substring rmail-this-buffer
3717 bounce-start bounce-end) 3734 bounce-start bounce-end)
@@ -3721,6 +3738,8 @@ specifying headers which should not be copied into the new message."
3721 (mail-sendmail-delimit-header) 3738 (mail-sendmail-delimit-header)
3722 (save-restriction 3739 (save-restriction
3723 (narrow-to-region (point-min) (mail-header-end)) 3740 (narrow-to-region (point-min) (mail-header-end))
3741 (rmail-delete-headers rmail-retry-ignored-headers)
3742 (rmail-delete-headers "^\\(sender\\|return-path\\|received\\):")
3724 (setq resending (mail-fetch-field "resent-to")) 3743 (setq resending (mail-fetch-field "resent-to"))
3725 (if mail-self-blind 3744 (if mail-self-blind
3726 (if resending 3745 (if resending