comparison lisp/mail/rmailout.el @ 22202:cca4f78e5e2a

(rmail-output-body-to-file): Avoid error if message has no subject. Use and set rmail-default-body-file.
author Richard M. Stallman <rms@gnu.org>
date Sat, 23 May 1998 20:08:57 +0000
parents be32396bfb04
children e7a998137db5
comparison
equal deleted inserted replaced
22201:40b715281ea5 22202:cca4f78e5e2a
331 (defun rmail-output-body-to-file (file-name) 331 (defun rmail-output-body-to-file (file-name)
332 "Write this message body to the file FILE-NAME. 332 "Write this message body to the file FILE-NAME.
333 FILE-NAME defaults, interactively, from the Subject field of the message." 333 FILE-NAME defaults, interactively, from the Subject field of the message."
334 (interactive 334 (interactive
335 (let ((default-file 335 (let ((default-file
336 (mail-fetch-field "Subject"))) 336 (or (mail-fetch-field "Subject")
337 (list (read-file-name 337 rmail-default-body-file)))
338 "Output message body to file: " 338 (list (setq rmail-default-body-file
339 (file-name-directory default-file) 339 (read-file-name
340 default-file 340 "Output message body to file: "
341 nil default-file)))) 341 (and default-file (file-name-directory default-file))
342 default-file
343 nil default-file)))))
344 (setq file-name
345 (expand-file-name file-name
346 (and rmail-default-body-file
347 (file-name-directory rmail-default-body-file))))
342 (save-excursion 348 (save-excursion
343 (goto-char (point-min)) 349 (goto-char (point-min))
344 (search-forward "\n\n") 350 (search-forward "\n\n")
345 (and (file-exists-p file-name) 351 (and (file-exists-p file-name)
346 (not (y-or-n-p (message "File %s exists; overwrite? " file-name))) 352 (not (y-or-n-p (message "File %s exists; overwrite? " file-name)))