changeset 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 40b715281ea5
children 481d174f762a
files lisp/mail/rmailout.el
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailout.el	Sat May 23 20:08:19 1998 +0000
+++ b/lisp/mail/rmailout.el	Sat May 23 20:08:57 1998 +0000
@@ -333,12 +333,18 @@
 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")