Mercurial > emacs
comparison lisp/mail/rmailout.el @ 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 | c945c9845f01 |
children | 35d8e74c6edb |
comparison
equal
deleted
inserted
replaced
17304:ecacd8936926 | 17305:7a3eb2b72749 |
---|---|
318 (if (= num-appended 1) "" "s")))) | 318 (if (= num-appended 1) "" "s")))) |
319 (setq count 0)))))) | 319 (setq count 0)))))) |
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 |
327 (let ((default-file | 327 (let ((default-file |
328 (mail-fetch-field "Subject"))) | 328 (mail-fetch-field "Subject"))) |
332 default-file | 332 default-file |
333 nil default-file)))) | 333 nil default-file)))) |
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))) |
340 (if rmail-delete-after-output | 343 (if rmail-delete-after-output |
341 (rmail-delete-forward))) | 344 (rmail-delete-forward))) |