Patch by Ed L. Cashin to make gnus-move-split-methods move to
[gnus] / lisp / nnspool.el
index dd0b28a..5cbfed7 100644 (file)
@@ -136,15 +136,20 @@ there.")
              (setq beg (point))
              (inline (nnheader-insert-head file))
              (goto-char beg)
-             (search-forward "\n\n" nil t)
-             (forward-char -1)
-             (insert ".\n")
+             (if (search-forward "\n\n" nil t)
+                 (progn
+                   (forward-char -1)
+                   (insert ".\n"))
+               (goto-char (point-max))
+               (if (bolp)
+                   (insert ".\n")
+                 (insert "\n.\n")))
              (delete-region (point) (point-max)))
 
            (and do-message
                 (zerop (% (incf count) 20))
                 (nnheader-message 5 "nnspool: Receiving headers... %d%%"
-                         (/ (* count 100) number))))
+                                  (/ (* count 100) number))))
 
          (when do-message
            (nnheader-message 5 "nnspool: Receiving headers...done"))
@@ -279,7 +284,7 @@ there.")
        (while (and (not (looking-at
                          "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] "))
                    (zerop (forward-line -1))))
-       (let ((seconds (time-to-float (date-to-time date)))
+       (let ((seconds (time-to-seconds (date-to-time date)))
              groups)
          ;; Go through lines and add the latest groups to a list.
          (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ")
@@ -294,8 +299,8 @@ there.")
                             (read (current-buffer)))
                           seconds))
                      (push (buffer-substring
-                                         (match-beginning 1) (match-end 1))
-                                        groups)
+                            (match-beginning 1) (match-end 1))
+                           groups)
                      (zerop (forward-line -1))))
          (erase-buffer)
          (while groups
@@ -419,7 +424,6 @@ there.")
 (defun nnspool-find-id (id)
   (save-excursion
     (set-buffer (get-buffer-create " *nnspool work*"))
-    (buffer-disable-undo (current-buffer))
     (erase-buffer)
     (ignore-errors
       (call-process "grep" nil t nil (regexp-quote id) nnspool-history-file))
@@ -434,8 +438,8 @@ there.")
   (set-buffer nntp-server-buffer)
   (erase-buffer)
   (condition-case ()
-      (let ((nnheader-file-coding-system nnspool-file-coding-system))
-       (nnheader-insert-file-contents file)
+      (let ((coding-system-for-read nnspool-file-coding-system))
+       (mm-insert-file-contents file)
        t)
     (file-error nil)))