Merge remote branch 'origin/no-gnus'
[gnus] / lisp / gnus-start.el
index 782773d..53ae6e1 100644 (file)
@@ -763,8 +763,8 @@ prompt the user for the name of an NNTP server to use."
     ;; Add "native" to gnus-predefined-server-alist just to have a
     ;; name for the native select method.
     (when gnus-select-method
-      (push (cons "native" gnus-select-method)
-           gnus-predefined-server-alist))
+      (add-to-list 'gnus-predefined-server-alist
+                  (cons "native" gnus-select-method)))
 
     (if gnus-agent
        (gnus-agentize))
@@ -1504,8 +1504,6 @@ backend check whether the group actually exists."
             ;; Return the new active info.
             active)))))
 
-(defvar gnus-propagate-marks)          ; gnus-sum
-
 (defun gnus-get-unread-articles-in-group (info active &optional update)
   (when (and info active)
     ;; Allow the backend to update the info in the group.
@@ -1515,13 +1513,6 @@ backend check whether the group actually exists."
                              (gnus-info-group info)))))
       (gnus-activate-group (gnus-info-group info) nil t))
 
-    ;; Allow backends to update marks,
-    (when gnus-propagate-marks
-      (let ((method (inline (gnus-find-method-for-group
-                            (gnus-info-group info)))))
-       (when (gnus-check-backend-function 'request-marks (car method))
-         (gnus-request-marks info method))))
-
     (let* ((range (gnus-info-read info))
           (num 0))
 
@@ -1714,6 +1705,21 @@ backend check whether the group actually exists."
          (with-current-buffer nntp-server-buffer
            (gnus-read-active-file-1 method nil)))))
 
+    ;; Clear out all the early methods.
+    (dolist (elem type-cache)
+      (destructuring-bind (method method-type infos dummy) elem
+       (when (and method
+                  infos
+                  (gnus-check-backend-function
+                   'retrieve-group-data-early (car method))
+                  (not (gnus-method-denied-p method)))
+         (when (ignore-errors (gnus-get-function method 'open-server))
+           (unless (gnus-server-opened method)
+             (gnus-open-server method))
+           (when (gnus-server-opened method)
+             ;; Just mark this server as "cleared".
+             (gnus-retrieve-group-data-early method nil))))))
+
     ;; Start early async retrieval of data.
     (let ((done-methods nil)
          sanity-spec)
@@ -2288,7 +2294,20 @@ If FORCE is non-nil, the .newsrc file is read."
          (gnus-message 5 "Reading %s...done" newsrc-file)))
 
       ;; Convert old to new.
-      (gnus-convert-old-newsrc))))
+      (gnus-convert-old-newsrc)
+      (gnus-clean-old-newsrc))))
+
+(defun gnus-clean-old-newsrc (&optional force)
+  (when gnus-newsrc-file-version
+    (when (or force
+             (< (gnus-continuum-version gnus-newsrc-file-version)
+                (gnus-continuum-version "Ma Gnus v0.03")))
+      ;; Remove old `exist' marks from old nnimap groups.
+      (dolist (info (cdr gnus-newsrc-alist))
+       (let ((exist (assoc 'unexist (gnus-info-marks info))))
+         (when exist
+           (gnus-info-set-marks
+            info (delete exist (gnus-info-marks info)))))))))
 
 (defun gnus-convert-old-newsrc ()
   "Convert old newsrc formats into the current format, if needed."