Remove <a name...> tags, which confuses the rest of the function.
[gnus] / lisp / gnus-start.el
index f99a1dc..a349475 100644 (file)
@@ -1688,6 +1688,7 @@ If SCAN, request a scan of that group as well."
         (methods-cache nil)
         (type-cache nil)
         (gnus-agent-article-local-times 0)
+        (archive-method (gnus-server-to-method "archive"))
         infos info group active method cmethod
         method-type method-group-list)
     (gnus-message 6 "Checking new news...")
@@ -1723,7 +1724,9 @@ If SCAN, request a scan of that group as well."
       (unless method-group-list
        (setq method-type
              (cond
-              ((gnus-secondary-method-p method)
+              ((or (gnus-secondary-method-p method)
+                   (and (gnus-archive-server-wanted-p)
+                        (gnus-methods-equal-p archive-method method)))
                'secondary)
               ((inline (gnus-server-equal gnus-select-method method))
                'primary)
@@ -1731,8 +1734,13 @@ If SCAN, request a scan of that group as well."
                'foreign)))
        (push (setq method-group-list (list method method-type nil))
              type-cache))
-      (setcar (nthcdr 2 method-group-list)
-             (cons info (nth 2 method-group-list))))
+      ;; Only add groups that need updating.
+      (when (<= (gnus-info-level info)
+               (if (eq (cadr method-group-list) 'foreign)
+                   foreign-level
+                 alevel))
+       (setcar (nthcdr 2 method-group-list)
+               (cons info (nth 2 method-group-list)))))
 
     ;; Sort the methods based so that the primary and secondary
     ;; methods come first.  This is done for legacy reasons to try to
@@ -1750,19 +1758,13 @@ If SCAN, request a scan of that group as well."
            infos (nth 2 (car type-cache)))
       (pop type-cache)
 
-      (when method
+      (when (and method
+                infos)
        ;; See if any of the groups from this method require updating.
-       (when (block nil
-               (dolist (info infos)
-                 (when (<= (gnus-info-level info)
-                           (if (eq method-type 'foreign)
-                               foreign-level
-                             alevel))
-                   (return t))))
-         (gnus-read-active-for-groups method infos)
-         (dolist (info infos)
-           (inline (gnus-get-unread-articles-in-group
-                    info (gnus-active (gnus-info-group info))))))))
+       (gnus-read-active-for-groups method infos)
+       (dolist (info infos)
+         (inline (gnus-get-unread-articles-in-group
+                  info (gnus-active (gnus-info-group info)))))))
     (gnus-message 6 "Checking new news...done")))
 
 (defun gnus-method-rank (type method)
@@ -1790,6 +1792,8 @@ If SCAN, request a scan of that group as well."
   (with-current-buffer nntp-server-buffer
     (cond
      ((gnus-check-backend-function 'retrieve-groups (car method))
+      (when (gnus-check-backend-function 'request-scan (car method))
+       (gnus-request-scan nil method))
       (gnus-read-active-file-2
        (mapcar (lambda (info)
                 (gnus-group-real-name (gnus-info-group info)))