summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-03-30 22:22:32 +0000
committerRichard M. Stallman <rms@gnu.org>1997-03-30 22:22:32 +0000
commitcad9b4a677ce5a38c7836fe1c7140d434de77097 (patch)
tree4473a6fb6b3eed54fcdbca30e5197bc4d03bbc5b
parentdf181f30ea05da9687c7e6a96a8bf105a68ac563 (diff)
downloademacs-cad9b4a677ce5a38c7836fe1c7140d434de77097.tar.gz
(rmail-output-body): New command.
-rw-r--r--lisp/mail/rmailout.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 29621cc955d..533283d8884 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -319,4 +319,25 @@ The optional fourth argument FROM-GNUS is set when called from GNUS."
(setq count 0))))))
(kill-buffer tembuf))))
+;;;###autoload
+(defun rmail-output-body (file-name)
+ "Write this message body to the file FILE-NAME.
+FILE-NAME defaults, interactively, from the Subject field of the message."
+ (interactive
+ (let ((default-file
+ (mail-fetch-field "Subject")))
+ (list (read-file-name
+ "Output message body to file: "
+ (file-name-directory default-file)
+ default-file
+ nil default-file))))
+ (save-excursion
+ (goto-char (point-min))
+ (search-forward "\n\n")
+ (write-region (point) (point-max) file-name)
+ (if (equal major-mode 'rmail-mode)
+ (rmail-set-attribute "stored" t)))
+ (if rmail-delete-after-output
+ (rmail-delete-forward)))
+
;;; rmailout.el ends here