aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1996-02-21 21:28:05 +0000
committerKarl Heuer1996-02-21 21:28:05 +0000
commit9f606031b3a15efc844eea8dc84ed46d26ced60a (patch)
treea7b565aac90474504aaee052dd653e4ba09f7f5c
parentd32de959fdfe7fffb9a68516eceb689e163cf291 (diff)
downloademacs-9f606031b3a15efc844eea8dc84ed46d26ced60a.tar.gz
emacs-9f606031b3a15efc844eea8dc84ed46d26ced60a.zip
(unforward-rmail-message): New command.
-rw-r--r--lisp/mail/undigest.el36
1 files changed, 36 insertions, 0 deletions
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index 9e78bcef3c1..814198f3baf 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -132,4 +132,40 @@ Leaves original message, deleted, before the undigestified messages."
132 (delete-region (point-min) (point-max)) 132 (delete-region (point-min) (point-max))
133 (rmail-show-message rmail-current-message)))))) 133 (rmail-show-message rmail-current-message))))))
134 134
135(defun unforward-rmail-message ()
136 "Extract a forwarded message from the containing message.
137This puts the forwarded message into a separate rmail message
138following the containing message."
139 (interactive)
140 (narrow-to-region (rmail-msgbeg rmail-current-message)
141 (rmail-msgend rmail-current-message))
142 (goto-char (point-min))
143 (let (beg end (buffer-read-only nil) msg-string who-forwarded-it)
144 (setq who-forwarded-it (mail-fetch-field "From"))
145 (if (re-search-forward "^-* Start of forwarded message -*$" nil t)
146 (setq beg (1+ (point)))
147 (error "No forwarded message"))
148 (if (re-search-forward "^-* End of forwarded message -*$" nil t)
149 (setq end (match-beginning 0))
150 (error "No terminator for forwarded message"))
151 (widen)
152 (setq msg-string (buffer-substring beg end))
153 (goto-char (rmail-msgend rmail-current-message))
154 (narrow-to-region (point) (point))
155 (insert "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
156 (narrow-to-region (point) (point))
157 (insert "Forwarded-by: " who-forwarded-it "\n")
158 (insert msg-string)
159 (goto-char (point-min))
160 (while (not (eobp))
161 (if (looking-at "- ")
162 (delete-region (point) (+ 2 (point))))
163 (forward-line 1))
164 (let ((n rmail-current-message))
165 (rmail-forget-messages)
166 (rmail-show-message n)
167 (if (rmail-summary-exists)
168 (rmail-select-summary
169 (rmail-update-summary))))))
170
135;;; undigest.el ends here 171;;; undigest.el ends here