*** empty log message ***
[gnus] / lisp / nnspool.el
index fb8b954..95124de 100644 (file)
@@ -103,6 +103,7 @@ there.")
     (nnspool-active-file ,nnspool-active-file)
     (nnspool-newsgroups-file ,nnspool-newsgroups-file)
     (nnspool-distributions-file ,nnspool-distributions-file)
+    (nnspool-rejected-article-hook nil)
     (nnspool-history-file ,nnspool-history-file)
     (nnspool-active-times-file ,nnspool-active-times-file)
     (nnspool-large-newsgroup ,nnspool-large-newsgroup)
@@ -123,6 +124,7 @@ there.")
     (when (nnspool-possibly-change-directory group)
       (let* ((number (length articles))
             (count 0)
+            (default-directory nnspool-current-directory)
             (do-message (and (numberp nnspool-large-newsgroup)
                              (> number nnspool-large-newsgroup)))
             file beg article ag)
@@ -131,8 +133,7 @@ there.")
            ;; We successfully retrieved the NOV headers.
            'nov
          ;; No NOV headers here, so we do it the hard way.
-         (while articles
-           (setq article (pop articles))
+         (while (setq article (pop articles))
            (if (stringp article)
                ;; This is a Message-ID.
                (setq ag (nnspool-find-id article)
@@ -140,14 +141,15 @@ there.")
                                    (car ag) (cdr ag)))
                      article (cdr ag))
              ;; This is an article in the current group.
-             (setq file (nnspool-article-pathname 
-                         nnspool-current-group article)))
+             (setq file (int-to-string article)))
            ;; Insert the head of the article.
            (when (and file
                       (file-exists-p file))
-             (insert (format "221 %d Article retrieved.\n" article))
+             (insert "221 ")
+             (princ article (current-buffer))
+             (insert " Article retrieved.\n")
              (setq beg (point))
-             (nnheader-insert-head file)
+             (inline (nnheader-insert-head file))
              (goto-char beg)
              (search-forward "\n\n" nil t)
              (forward-char -1)
@@ -410,16 +412,21 @@ there.")
               (setq min (point)))
              (t
               (setq found t)))))
+    ;; Now we may have found the article we're looking for, or we
+    ;; may be somewhere near it.
     (when (not (eq num article))
       (setq found (point))
-      (forward-line 1)
-      (or (eobp)
-         (= (setq num (read cur)) article)
-         (goto-char found)))
+      (while (and (< (point) max)
+                 (< num article))
+       (forward-line 1)
+       (setq found (point))
+       (or (eobp)
+           (= (setq num (read cur)) article)))
+      (unless (eq num article)
+       (goto-char found)))
     (beginning-of-line)
     (eq num article)))
     
-
 (defun nnspool-sift-nov-with-sed (articles file)
   (let ((first (car articles))
        (last (progn (while (cdr articles) (setq articles (cdr articles)))