From 4469385cdc5c7c22439209b3015a7396e6fcc881 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 5 Sep 2010 00:44:53 +0000 Subject: [PATCH] gnus-agent.el (gnus-agent-load-local): Only read the agent.lib/local file once per `g' run. --- lisp/gnus/ChangeLog | 3 +++ lisp/gnus/gnus-agent.el | 17 +++++++++++------ lisp/gnus/gnus-start.el | 1 + lisp/gnus/nnmh.el | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 76ca82eb710..b73216ae702 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,8 @@ 2010-09-04 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index c5232819379..bbfdc66af99 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -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)) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 16a733d1452..b111f5caa19 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -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...") diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el index ba9eb232f3b..17311b9688c 100644 --- a/lisp/gnus/nnmh.el +++ b/lisp/gnus/nnmh.el @@ -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) -- 2.39.2