This commit was generated by cvs2svn to compensate for changes in r8000,
[elisp/gnus.git-] / lisp / nnsoup.el
index f0f4d7c..e764150 100644 (file)
 (defvoo nnsoup-directory "~/SOUP/"
   "*SOUP packet directory.")
 
-(defvoo nnsoup-tmp-directory
-    (cond ((fboundp 'temp-directory) (temp-directory))
-         ((boundp 'temporary-file-directory) temporary-file-directory)
-         ("/tmp/"))
+(defvoo nnsoup-tmp-directory "/tmp/"
   "*Where nnsoup will store temporary files.")
 
 (defvoo nnsoup-replies-directory (concat nnsoup-directory "replies/")
@@ -379,7 +376,7 @@ backend for the messages.")
             (or force
                 nnsoup-group-alist-touched))
     (setq nnsoup-group-alist-touched nil)
-    (with-temp-file nnsoup-active-file
+    (nnheader-temp-write nnsoup-active-file
       (gnus-prin1 `(setq nnsoup-group-alist ',nnsoup-group-alist))
       (insert "\n")
       (gnus-prin1 `(setq nnsoup-current-prefix ,nnsoup-current-prefix))
@@ -533,7 +530,7 @@ backend for the messages.")
        (when (file-exists-p (concat nnsoup-directory file))
          (save-excursion               ; Load the file.
            (set-buffer (get-buffer-create buffer-name))
-           (buffer-disable-undo)
+           (buffer-disable-undo (current-buffer))
            (push (cons nnsoup-current-group (current-buffer)) nnsoup-buffers)
            (nnheader-insert-file-contents (concat nnsoup-directory file))
            (current-buffer))))))
@@ -669,6 +666,8 @@ backend for the messages.")
   (require 'mail-utils)
   (let ((tembuf (generate-new-buffer " message temp"))
        (case-fold-search nil)
+       (real-header-separator mail-header-separator)
+       (mail-header-separator "")
        delimline
        (mailbuf (current-buffer)))
     (unwind-protect
@@ -694,11 +693,15 @@ backend for the messages.")
            ;; Change header-delimiter to be what sendmail expects.
            (goto-char (point-min))
            (re-search-forward
-            (concat "^" (regexp-quote mail-header-separator) "\n"))
+            (concat "^" (regexp-quote real-header-separator) "\n"))
            (replace-match "\n")
            (backward-char 1)
            (setq delimline (point-marker))
+           ;; Insert an extra newline if we need it to work around
+           ;; Sun's bug that swallows newlines.
            (goto-char (1+ delimline))
+           (when (eval message-mailer-swallows-blank-line)
+             (newline))
            (let ((msg-buf
                   (gnus-soup-store
                    nnsoup-replies-directory
@@ -749,6 +752,7 @@ backend for the messages.")
                                 (string-to-int (match-string 1 f2)))))))
        active group lines ident elem min)
     (set-buffer (get-buffer-create " *nnsoup work*"))
+    (buffer-disable-undo (current-buffer))
     (while files
       (nnheader-message 5 "Doing %s..." (car files))
       (erase-buffer)