summaryrefslogtreecommitdiff
path: root/lisp/mail/undigest.el
diff options
context:
space:
mode:
authorFrancesco Potortì <pot@gnu.org>2003-02-20 08:56:08 +0000
committerFrancesco Potortì <pot@gnu.org>2003-02-20 08:56:08 +0000
commit89dac01fd8a668f13d467fe22bdb413d53f5a937 (patch)
tree63263172ed9f7611523493d0af8573bba42a88d9 /lisp/mail/undigest.el
parentf39e98ea0ef7700a059080bd2a7c204aba4a55fe (diff)
downloademacs-89dac01fd8a668f13d467fe22bdb413d53f5a937.tar.gz
(unforward-rmail-message): Allow nested
unforwarding, that is, preserve old Forwarded-From/Date headers.
Diffstat (limited to 'lisp/mail/undigest.el')
-rw-r--r--lisp/mail/undigest.el22
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index d5efa06df71..1890353c33b 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -232,13 +232,18 @@ following the containing message."
;; If we are in a summary buffer, switch to the Rmail buffer.
(unwind-protect
(with-current-buffer rmail-buffer
- (narrow-to-region (rmail-msgbeg rmail-current-message)
- (rmail-msgend rmail-current-message))
(goto-char (point-min))
+ (narrow-to-region (point)
+ (save-excursion (search-forward "\n\n") (point)))
(let ((buffer-read-only nil)
- (forwarded-from (mail-fetch-field "From"))
- (forwarded-date (mail-fetch-field "Date"))
+ (old-fwd-from (mail-fetch-field "Forwarded-From" nil nil t))
+ (old-fwd-date (mail-fetch-field "Forwarded-Date" nil nil t))
+ (fwd-from (mail-fetch-field "From"))
+ (fwd-date (mail-fetch-field "Date"))
beg end prefix forward-msg)
+ (narrow-to-region (rmail-msgbeg rmail-current-message)
+ (rmail-msgend rmail-current-message))
+ (goto-char (point-min))
(cond ((re-search-forward rmail-forward-separator-regex nil t)
(forward-line 1)
(skip-chars-forward "\n")
@@ -274,8 +279,13 @@ following the containing message."
(narrow-to-region (point) (point))
(insert rmail-mail-separator)
(narrow-to-region (point) (point))
- (insert "Forwarded-From: " forwarded-from "\n")
- (insert "Forwarded-Date: " forwarded-date "\n")
+ (while old-fwd-from
+ (insert "Forwarded-From: " (car old-fwd-from) "\n")
+ (insert "Forwarded-Date: " (car old-fwd-date) "\n")
+ (setq old-fwd-from (cdr old-fwd-from))
+ (setq old-fwd-date (cdr old-fwd-date)))
+ (insert "Forwarded-From: " fwd-from "\n")
+ (insert "Forwarded-Date: " fwd-date "\n")
(insert forward-msg)
(save-restriction
(goto-char (point-min))