From de62d9e98353da9b87926bed109a58059cd61679 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 9 Apr 2009 16:48:25 +0000 Subject: [PATCH] * mail/rmailout.el (rmail-output): If file is visited, check the buffer's format. --- lisp/ChangeLog | 3 +++ lisp/mail/rmailout.el | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a4050c3e5e..00bc4b3d71 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-04-09 Richard M Stallman + * mail/rmailout.el (rmail-output): If file is visited, + check the buffer's format. + * mail/rmailout.el (rmail-convert-to-babyl-format): Don't set "unseen". * mail/rmailout.el (rmail-output-to-rmail-buffer): diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index b6f20df69a..dad696f535 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -434,7 +434,20 @@ from a non-Rmail buffer. In this case, COUNT is ignored." (if noattribute (setq noattribute 'nomsg)) (let ((babyl-format (and (file-readable-p file-name) (mail-file-babyl-p file-name))) - (cur (current-buffer))) + (cur (current-buffer)) + (buf (find-buffer-visiting file-name))) + + ;; If a babyl file is visited in a buffer, is it visited as babyl + ;; or as mbox? + (and babyl-format buf + (with-current-buffer buf + (save-restriction + (widen) + (save-excursion + (goto-char (point-min)) + (setq babyl-format + (looking-at "BABYL OPTIONS:")))))) + (if not-rmail ; eg via message-fcc-handler-function (with-temp-buffer (insert-buffer-substring cur) -- 2.39.2