changeset 110191:1e69e141b6a0

gnus-agent.el (gnus-agent-load-local): Only read the agent.lib/local file once per `g' run.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 05 Sep 2010 00:44:53 +0000
parents 896692b6eb7b
children 5e4124c807eb
files lisp/gnus/ChangeLog lisp/gnus/gnus-agent.el lisp/gnus/gnus-start.el lisp/gnus/nnmh.el
diffstat 4 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Sun Sep 05 00:38:39 2010 +0000
+++ b/lisp/gnus/ChangeLog	Sun Sep 05 00:44:53 2010 +0000
@@ -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.
 
--- a/lisp/gnus/gnus-agent.el	Sun Sep 05 00:38:39 2010 +0000
+++ b/lisp/gnus/gnus-agent.el	Sun Sep 05 00:44:53 2010 +0000
@@ -2232,23 +2232,28 @@
     (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))
--- a/lisp/gnus/gnus-start.el	Sun Sep 05 00:38:39 2010 +0000
+++ b/lisp/gnus/gnus-start.el	Sun Sep 05 00:44:53 2010 +0000
@@ -1684,6 +1684,7 @@
 	   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...")
--- a/lisp/gnus/nnmh.el	Sun Sep 05 00:38:39 2010 +0000
+++ b/lisp/gnus/nnmh.el	Sun Sep 05 00:44:53 2010 +0000
@@ -248,7 +248,7 @@
 	       ?/ ?.)
 	      nnmail-pathname-coding-system)))
 	  (or max 0)
-	  (or min 0))))))
+	  (or min 1))))))
   t)
 
 (deffoo nnmh-request-newgroups (date &optional server)