]> git.eshelyaron.com Git - emacs.git/commitdiff
* mail/rmailout.el (rmail-output): If file is visited,
authorRichard M. Stallman <rms@gnu.org>
Thu, 9 Apr 2009 16:48:25 +0000 (16:48 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 9 Apr 2009 16:48:25 +0000 (16:48 +0000)
check the buffer's format.

lisp/ChangeLog
lisp/mail/rmailout.el

index a4050c3e5ea972e00badd48bc7e8de1f04e6723a..00bc4b3d71dba1121fe3651c3b4961c42a9bebf0 100644 (file)
@@ -1,5 +1,8 @@
 2009-04-09  Richard M Stallman  <rms@gnu.org>
 
+       * 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):
index b6f20df69a0cd91e99b59f11b45110e8301581e7..dad696f5355a6a5af73c161aac3b90f12f85ee6e 100644 (file)
@@ -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)