diff options
| author | Richard M. Stallman | 1997-04-05 21:38:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-04-05 21:38:07 +0000 |
| commit | a24de134006e8c1435cce5052738cdcead4d3bb9 (patch) | |
| tree | 18c8f1b93875ba0a482b4ca32f659a048d2a4dc8 | |
| parent | ccdb79f5d90634c98f515be534639a797a217a11 (diff) | |
| download | emacs-a24de134006e8c1435cce5052738cdcead4d3bb9.tar.gz emacs-a24de134006e8c1435cce5052738cdcead4d3bb9.zip | |
(rmail-output-body-to-file): Query if file exists.
Renamed from rmail-output-body.
| -rw-r--r-- | lisp/mail/rmailout.el | 5 |
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." | |||
| 320 | (kill-buffer tembuf)))) | 320 | (kill-buffer tembuf)))) |
| 321 | 321 | ||
| 322 | ;;;###autoload | 322 | ;;;###autoload |
| 323 | (defun rmail-output-body (file-name) | 323 | (defun rmail-output-body-to-file (file-name) |
| 324 | "Write this message body to the file FILE-NAME. | 324 | "Write this message body to the file FILE-NAME. |
| 325 | FILE-NAME defaults, interactively, from the Subject field of the message." | 325 | FILE-NAME defaults, interactively, from the Subject field of the message." |
| 326 | (interactive | 326 | (interactive |
| @@ -334,6 +334,9 @@ FILE-NAME defaults, interactively, from the Subject field of the message." | |||
| 334 | (save-excursion | 334 | (save-excursion |
| 335 | (goto-char (point-min)) | 335 | (goto-char (point-min)) |
| 336 | (search-forward "\n\n") | 336 | (search-forward "\n\n") |
| 337 | (and (file-exists-p file-name) | ||
| 338 | (not (y-or-n-p (message "File %s exists; overwrite? " file-name))) | ||
| 339 | (error "Operation aborted")) | ||
| 337 | (write-region (point) (point-max) file-name) | 340 | (write-region (point) (point-max) file-name) |
| 338 | (if (equal major-mode 'rmail-mode) | 341 | (if (equal major-mode 'rmail-mode) |
| 339 | (rmail-set-attribute "stored" t))) | 342 | (rmail-set-attribute "stored" t))) |