]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-do-fcc): Handle dont-write-the-file
authorKarl Heuer <kwzh@gnu.org>
Mon, 20 Oct 1997 03:49:42 +0000 (03:49 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 20 Oct 1997 03:49:42 +0000 (03:49 +0000)
correctly--don't write msg to the file after saving it from a buffer.

lisp/mail/sendmail.el

index 6b7ab2b1f1fd6743569a8e6fe140286f06662110..e1b1b8f2936b8a7cf4f7ad0609af8ae14fd842b8 100644 (file)
@@ -905,26 +905,26 @@ the user from the mailer."
                    (if max (narrow-to-region (point-min) max))))))
          ;; Append to the file directly,
          ;; unless we've already taken care of it.
-         (if (and (not dont-write-the-file)
-                  (file-exists-p (car fcc-list))
-                  (mail-file-babyl-p (car fcc-list)))
-             ;; If the file is a Babyl file,
-             ;; convert the message to Babyl format.
-             (let ((coding-system-for-write
-                    (or rmail-file-coding-system
-                        'emacs-mule)))
-               (save-excursion
-                 (set-buffer (get-buffer-create " mail-temp"))
-                 (setq buffer-read-only nil)
-                 (erase-buffer)
-                 (insert "\C-l\n0, unseen,,\n*** EOOH ***\n"
-                         "Date: " (mail-rfc822-date) "\n")
-                 (insert-buffer-substring curbuf beg2 end)
-                 (insert "\n\C-_")
-                 (write-region (point-min) (point-max) (car fcc-list) t)
-                 (erase-buffer)))
-           (write-region
-            (1+ (point-min)) (point-max) (car fcc-list) t))
+         (unless dont-write-the-file
+           (if (and (file-exists-p (car fcc-list))
+                    (mail-file-babyl-p (car fcc-list)))
+               ;; If the file is a Babyl file,
+               ;; convert the message to Babyl format.
+               (let ((coding-system-for-write
+                      (or rmail-file-coding-system
+                          'emacs-mule)))
+                 (save-excursion
+                   (set-buffer (get-buffer-create " mail-temp"))
+                   (setq buffer-read-only nil)
+                   (erase-buffer)
+                   (insert "\C-l\n0, unseen,,\n*** EOOH ***\n"
+                           "Date: " (mail-rfc822-date) "\n")
+                   (insert-buffer-substring curbuf beg2 end)
+                   (insert "\n\C-_")
+                   (write-region (point-min) (point-max) (car fcc-list) t)
+                   (erase-buffer)))
+             (write-region
+              (1+ (point-min)) (point-max) (car fcc-list) t)))
          (and buffer (not dont-write-the-file)
               (with-current-buffer buffer
                 (set-visited-file-modtime))))