Only read the agent.lib/local file once per `g' run.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 4 Sep 2010 18:12:43 +0000 (20:12 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 4 Sep 2010 18:12:43 +0000 (20:12 +0200)
lisp/ChangeLog
lisp/gnus-agent.el
lisp/gnus-start.el
lisp/nnmh.el

index 5baafbc..055fb1b 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-agent.el (gnus-agent-load-local): Only read the agent.lib/local
+       file once per `g' run.
+
        * nnmh.el (nnmh-request-list-1): Output active lines also for empty
        directories.  This makes the draft queue directory work.
 
index c523281..bbfdc66 100644 (file)
@@ -2232,23 +2232,28 @@ doesn't exist, to valid the overview buffer."
     (gnus-agent-update-view-total-fetched-for group nil)))
 
 (defvar gnus-agent-article-local nil)
+(defvar gnus-agent-article-local-times nil)
 (defvar gnus-agent-file-loading-local nil)
 
 (defun gnus-agent-load-local (&optional method)
   "Load the METHOD'S local file.  The local file contains min/max
 article counts for each of the method's subscribed groups."
   (let ((gnus-command-method (or method gnus-command-method)))
-    (setq gnus-agent-article-local
-          (gnus-cache-file-contents
-           (gnus-agent-lib-file "local")
-           'gnus-agent-file-loading-local
-           'gnus-agent-read-and-cache-local))))
+    (when (or (null gnus-agent-article-local-times)
+             (zerop gnus-agent-article-local-times))
+      (setq gnus-agent-article-local
+           (gnus-cache-file-contents
+            (gnus-agent-lib-file "local")
+            'gnus-agent-file-loading-local
+            'gnus-agent-read-and-cache-local))
+      (when gnus-agent-article-local-times
+       (incf gnus-agent-article-local-times)))
+    gnus-agent-article-local))
 
 (defun gnus-agent-read-and-cache-local (file)
   "Load and read FILE then bind its contents to
 gnus-agent-article-local.  If that variable had `dirty' (also known as
 modified) original contents, they are first saved to their own file."
-
   (if (and gnus-agent-article-local
            (symbol-value (intern "+dirty" gnus-agent-article-local)))
       (gnus-agent-save-local))
index 16a733d..b111f5c 100644 (file)
@@ -1684,6 +1684,7 @@ If SCAN, request a scan of that group as well."
           alevel))
         (methods-cache nil)
         (type-cache nil)
+        (gnus-agent-article-local-times 0)
         infos info group active method cmethod
         method-type method-group-list)
     (gnus-message 6 "Checking new news...")
index ba9eb23..17311b9 100644 (file)
@@ -248,7 +248,7 @@ as unread by Gnus.")
               ?/ ?.)
              nnmail-pathname-coding-system)))
          (or max 0)
-         (or min 0))))))
+         (or min 1))))))
   t)
 
 (deffoo nnmh-request-newgroups (date &optional server)