From: Richard M. Stallman Date: Sat, 23 May 1998 20:08:57 +0000 (+0000) Subject: (rmail-output-body-to-file): Avoid error if message has no subject. X-Git-Tag: emacs-20.3~875 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d1cad4080e1ea4e14052750e84bb6eec4625ba69;p=emacs.git (rmail-output-body-to-file): Avoid error if message has no subject. Use and set rmail-default-body-file. --- diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 1834ff5ae26..7a8bfcf393e 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -333,12 +333,18 @@ The optional fourth argument FROM-GNUS is set when called from GNUS." FILE-NAME defaults, interactively, from the Subject field of the message." (interactive (let ((default-file - (mail-fetch-field "Subject"))) - (list (read-file-name - "Output message body to file: " - (file-name-directory default-file) - default-file - nil default-file)))) + (or (mail-fetch-field "Subject") + rmail-default-body-file))) + (list (setq rmail-default-body-file + (read-file-name + "Output message body to file: " + (and default-file (file-name-directory default-file)) + default-file + nil default-file))))) + (setq file-name + (expand-file-name file-name + (and rmail-default-body-file + (file-name-directory rmail-default-body-file)))) (save-excursion (goto-char (point-min)) (search-forward "\n\n")