changeset 17305:7a3eb2b72749

(rmail-output-body-to-file): Query if file exists. Renamed from rmail-output-body.
author Richard M. Stallman <rms@gnu.org>
date Sat, 05 Apr 1997 21:38:07 +0000
parents ecacd8936926
children 09aeacdc6fc2
files lisp/mail/rmailout.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailout.el	Sat Apr 05 07:48:17 1997 +0000
+++ b/lisp/mail/rmailout.el	Sat Apr 05 21:38:07 1997 +0000
@@ -320,7 +320,7 @@
       (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 @@
   (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)))