*** empty log message ***
[gnus] / lisp / nnsoup.el
index 24f3570..fcf2c62 100644 (file)
@@ -56,7 +56,7 @@
 (defvoo nnsoup-packer "tar cf - %s | gzip > $HOME/Soupin%d.tgz"
   "Format string command for packing a SOUP packet.
 The SOUP files will be inserted where the %s is in the string.
-This string MUST contain both %s and %d. The file number will be
+This string MUST contain both %s and %d.  The file number will be
 inserted where %d appears.")
 
 (defvoo nnsoup-unpacker "gunzip -c %s | tar xvf -"
@@ -261,6 +261,8 @@ The SOUP packet file name will be inserted at the %s.")
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)
+    (unless nnsoup-group-alist
+      (nnsoup-read-active-file))
     (let ((alist nnsoup-group-alist)
          (standard-output (current-buffer))
          entry)
@@ -342,7 +344,7 @@ The SOUP packet file name will be inserted at the %s.")
     t))
 
 (defun nnsoup-read-active-file ()
-  (setq nnsoup-group-alist)
+  (setq nnsoup-group-alist nil)
   (when (file-exists-p nnsoup-active-file)
     (condition-case ()
        (load nnsoup-active-file t t t)
@@ -367,11 +369,10 @@ The SOUP packet file name will be inserted at the %s.")
                 nnsoup-group-alist-touched))
     (setq nnsoup-group-alist-touched nil)
     (nnheader-temp-write nnsoup-active-file
-      (let ((standard-output (current-buffer)))
-       (prin1 `(setq nnsoup-group-alist ',nnsoup-group-alist))
-       (insert "\n")
-       (prin1 `(setq nnsoup-current-prefix ,nnsoup-current-prefix))
-       (insert "\n")))))
+      (gnus-prin1 `(setq nnsoup-group-alist ',nnsoup-group-alist))
+      (insert "\n")
+      (gnus-prin1 `(setq nnsoup-current-prefix ,nnsoup-current-prefix))
+      (insert "\n"))))
 
 (defun nnsoup-next-prefix ()
   "Return the next free prefix."
@@ -447,9 +448,9 @@ The SOUP packet file name will be inserted at the %s.")
 (defun nnsoup-index-buffer (prefix &optional message)
   (let* ((file (concat prefix (if message ".MSG" ".IDX")))
         (buffer-name (concat " *nnsoup " file "*")))
-    (or (get-buffer buffer-name)       ; File aready loaded.
+    (or (get-buffer buffer-name)       ; File already loaded.
        (when (file-exists-p (concat nnsoup-directory file))
-         (save-excursion                       ; Load the file.
+         (save-excursion               ; Load the file.
            (set-buffer (get-buffer-create buffer-name))
            (buffer-disable-undo (current-buffer))
            (push (cons nnsoup-current-group (current-buffer)) nnsoup-buffers)
@@ -541,7 +542,7 @@ The SOUP packet file name will be inserted at the %s.")
    ((= format ?n)
     "^#! *rnews +[0-9]+ *$")
    ((= format ?m)
-    (concat "^" rmail-unix-mail-delimiter))
+    (concat "^" message-unix-mail-delimiter))
    ((= format ?M)
     "^\^A\^A\^A\^A\n")
    (t
@@ -595,12 +596,15 @@ The SOUP packet file name will be inserted at the %s.")
   (require 'mail-utils)
   (let ((tembuf (generate-new-buffer " message temp"))
        (case-fold-search nil)
-       (news (message-news-p))
-       (resend-to-addresses (mail-fetch-field "resent-to"))
        delimline
        (mailbuf (current-buffer)))
     (unwind-protect
        (save-excursion
+         (save-restriction
+           (message-narrow-to-headers)
+           (if (equal kind "mail")
+               (message-generate-headers message-required-mail-headers)
+             (message-generate-headers message-required-news-headers)))
          (set-buffer tembuf)
          (erase-buffer)
          (insert-buffer-substring mailbuf)
@@ -608,19 +612,11 @@ The SOUP packet file name will be inserted at the %s.")
          (save-restriction
            (message-narrow-to-headers)
            ;; Remove some headers.
-           (message-remove-header message-ignored-mail-headers t)
-           (if (equal kind "mail")
-               (message-generate-headers message-required-mail-headers)
-             (message-generate-headers message-required-news-headers)))
+           (message-remove-header message-ignored-mail-headers t))
          (goto-char (point-max))
          ;; require one newline at the end.
          (or (= (preceding-char) ?\n)
              (insert ?\n))
-         (when (and news
-                    (equal kind "mail")
-                    (or (mail-fetch-field "cc")
-                        (mail-fetch-field "to")))
-           (message-insert-courtesy-copy))
          (let ((case-fold-search t))
            ;; Change header-delimiter to be what sendmail expects.
            (goto-char (point-min))