diff options
author | Francesco Potortì <pot@gnu.org> | 2002-12-23 22:51:38 +0000 |
---|---|---|
committer | Francesco Potortì <pot@gnu.org> | 2002-12-23 22:51:38 +0000 |
commit | 85e949963db7f0c9eaf42cc0968257021afae94a (patch) | |
tree | cc36b216c2472caf485b3c423638033e0f6db5b8 /lisp/mail/undigest.el | |
parent | 75b6ccddfa5faf1590d8a072504f5860844b0f3f (diff) | |
download | emacs-85e949963db7f0c9eaf42cc0968257021afae94a.tar.gz emacs-85e949963db7f0c9eaf42cc0968257021afae94a.tar.bz2 emacs-85e949963db7f0c9eaf42cc0968257021afae94a.zip |
(unforward-rmail-message): Do not assume that
the forwarded message's Date: header comes after From:. Use a
Forwarded-from: rather than a Forwarded-by: header. Add a
Forwarded-date: header.
Diffstat (limited to 'lisp/mail/undigest.el')
-rw-r--r-- | lisp/mail/undigest.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el index 839d796cf25..ff4673901b2 100644 --- a/lisp/mail/undigest.el +++ b/lisp/mail/undigest.el @@ -228,7 +228,8 @@ following the containing message." (rmail-msgend rmail-current-message)) (goto-char (point-min)) (let ((buffer-read-only nil) - (who-forwarded-it (mail-fetch-field "From")) + (forwarded-from (mail-fetch-field "From")) + (forwarded-date (mail-fetch-field "Date")) beg end prefix forward-msg n) (cond ((re-search-forward "^----.*\\([Ff]orwarded\\|[Oo]riginal\\).*[Mm]essage" nil t) @@ -239,12 +240,18 @@ following the containing message." (setq forward-msg (replace-regexp-in-string "^- -" "-" (buffer-substring beg end)))) - ((and (re-search-forward "^\\(> ?\\)From: .*\n" nil t) + ((and (re-search-forward "^\\(> ?\\)[a-zA-Z-]+: .*\n" nil t) (setq beg (match-beginning 0)) (setq prefix (match-string 1)) + (goto-char beg) (looking-at (concat "\\(" prefix ".+\n\\)*" prefix "Date: .+\n" "\\(" prefix ".+\n\\)*" + "\\(> ?\\)?\n" prefix)) + (goto-char beg) + (looking-at (concat "\\(" prefix ".+\n\\)*" + prefix "From: .+\n" + "\\(" prefix ".+\n\\)*" "\\(> ?\\)?\n" prefix))) (re-search-forward "^[^>\n]" nil 'move) (backward-char) @@ -262,7 +269,8 @@ following the containing message." (narrow-to-region (point) (point)) (insert rmail-mail-separator) (narrow-to-region (point) (point)) - (insert "Forwarded-by: " who-forwarded-it "\n") + (insert "Forwarded-from: " forwarded-from "\n") + (insert "Forwarded-date: " forwarded-date "\n") (insert forward-msg) (save-restriction (goto-char (point-min)) |