* gnus-agent.el (gnus-agent-load-alist): Nix out the alist if the file
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 01:57:57 +0000 (03:57 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 01:57:57 +0000 (03:57 +0200)
doesn't exist.

* nnimap.el (nnimap-finish-retrieve-group-infos): Protect against
groups that have no articles.

lisp/ChangeLog
lisp/gnus-agent.el
lisp/nnimap.el

index 073322f..05ff44f 100644 (file)
@@ -1,5 +1,11 @@
 2010-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-finish-retrieve-group-infos): Protect against
+       groups that have no articles.
+
+       * gnus-agent.el (gnus-agent-load-alist): Nix out the alist if the file
+       doesn't exist.
+
        * nnimap.el (nnimap-finish-retrieve-group-infos): Return data in the
        nntp buffer so the agent can save it.
        (nnimap-open-shell-stream): Bind `process-connection-type' to nil, so
index 6dcc77c..60d28b3 100644 (file)
@@ -2104,12 +2104,12 @@ doesn't exist, to valid the overview buffer."
   (let* ((gnus-agent-read-agentview group)
         (file-name-coding-system nnmail-pathname-coding-system)
         (agentview (gnus-agent-article-name ".agentview" group)))
-    (when (file-exists-p agentview)
-      (setq gnus-agent-article-alist
-           (gnus-cache-file-contents
-            agentview
-            'gnus-agent-file-loading-cache
-            'gnus-agent-read-agentview)))))
+    (setq gnus-agent-article-alist
+         (and (file-exists-p agentview)
+              (gnus-cache-file-contents
+               agentview
+               'gnus-agent-file-loading-cache
+               'gnus-agent-read-agentview)))))
 
 (defun gnus-agent-read-agentview (file)
   "Load FILE and do a `read' there."
@@ -2353,7 +2353,6 @@ modified) original contents, they are first saved to their own file."
          (local (or local (gnus-agent-load-local)))
          (symb (intern gmane local))
          (minmax (and (boundp symb) (symbol-value symb))))
-
     (if (cond ((and minmax
                     (or (not (eq min (car minmax)))
                         (not (eq max (cdr minmax))))
index 789c213..0fe5816 100644 (file)
@@ -617,10 +617,11 @@ not done by default on servers that doesn't support that command.")
        (dolist (info infos)
          (let* ((group (gnus-info-group info))
                 (active (gnus-active group)))
-           (insert (format "%S %d %d y\n"
-                           (gnus-group-real-name group)
-                           (cdr active)
-                           (car active)))))))))
+           (when active
+             (insert (format "%S %d %d y\n"
+                             (gnus-group-real-name group)
+                             (cdr active)
+                             (car active))))))))))
 
 (defun nnimap-update-infos (flags infos)
   (dolist (info infos)