summaryrefslogtreecommitdiff
path: root/lisp/mail/rmailout.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-04-05 21:38:07 +0000
committerRichard M. Stallman <rms@gnu.org>1997-04-05 21:38:07 +0000
commit196aba05070d39b90a3cd55c404613ae6cf46c35 (patch)
tree213e92e6c79053c2737d939ac2a817abd344008f /lisp/mail/rmailout.el
parentabeced63d7a464682dc91699900465ccc4ebb632 (diff)
downloademacs-196aba05070d39b90a3cd55c404613ae6cf46c35.tar.gz
(rmail-output-body-to-file): Query if file exists.
Renamed from rmail-output-body.
Diffstat (limited to 'lisp/mail/rmailout.el')
-rw-r--r--lisp/mail/rmailout.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index a82a9649afb..90ee095a46b 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -320,7 +320,7 @@ The optional fourth argument FROM-GNUS is set when called from GNUS."
(kill-buffer tembuf))))
;;;###autoload
-(defun rmail-output-body (file-name)
+(defun rmail-output-body-to-file (file-name)
"Write this message body to the file FILE-NAME.
FILE-NAME defaults, interactively, from the Subject field of the message."
(interactive
@@ -334,6 +334,9 @@ FILE-NAME defaults, interactively, from the Subject field of the message."
(save-excursion
(goto-char (point-min))
(search-forward "\n\n")
+ (and (file-exists-p file-name)
+ (not (y-or-n-p (message "File %s exists; overwrite? " file-name)))
+ (error "Operation aborted"))
(write-region (point) (point-max) file-name)
(if (equal major-mode 'rmail-mode)
(rmail-set-attribute "stored" t)))