changeset 110300:8e82c01724e1

gnus-start.el (gnus-read-active-for-groups): Check only subscribed groups.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 10 Sep 2010 05:33:13 +0000
parents 95864039082f (current diff) 593e2b90e58b (diff)
children e59d99dc1c71 44bf19a4d54b
files
diffstat 2 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Fri Sep 10 00:10:20 2010 +0000
+++ b/lisp/gnus/ChangeLog	Fri Sep 10 05:33:13 2010 +0000
@@ -1,3 +1,11 @@
+2010-09-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-start.el (gnus-read-active-for-groups): Check only subscribed
+	groups; replace mapcar with dolist which is a bit faster; pass groups
+	info to gnus-read-active-file-1.
+	(gnus-read-active-file-1): Scan only specified groups if the new
+	optional arg `infos' is given.
+
 2010-09-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* mail-source.el (mail-source-fetch-pop): Use pop3-movemail again.
--- a/lisp/gnus/gnus-start.el	Fri Sep 10 00:10:20 2010 +0000
+++ b/lisp/gnus/gnus-start.el	Fri Sep 10 05:33:13 2010 +0000
@@ -1801,14 +1801,15 @@
     (cond
      ((gnus-check-backend-function 'retrieve-groups (car method))
       (when (gnus-check-backend-function 'request-scan (car method))
-	(gnus-request-scan nil method))
-      (gnus-read-active-file-2
-       (mapcar (lambda (info)
-		 (gnus-group-real-name (gnus-info-group info)))
-	       infos)
-       method))
+	(dolist (info infos)
+	  (gnus-request-scan (gnus-info-group info) method)))
+      (let (groups)
+	(gnus-read-active-file-2
+	 (dolist (info infos (nreverse groups))
+	   (push (gnus-group-real-name (gnus-info-group info)) groups))
+	 method)))
      ((gnus-check-backend-function 'request-list (car method))
-      (gnus-read-active-file-1 method nil))
+      (gnus-read-active-file-1 method nil infos))
      (t
       (dolist (info infos)
 	(gnus-activate-group (gnus-info-group info) nil nil method t))))))
@@ -2037,7 +2038,7 @@
 	       (message "Quit reading the active file")
 	       nil))))))))
 
-(defun gnus-read-active-file-1 (method force)
+(defun gnus-read-active-file-1 (method force &optional infos)
   (let (where mesg)
     (setq where (nth 1 method)
 	  mesg (format "Reading active file%s via %s..."
@@ -2050,7 +2051,10 @@
       (when (and gnus-agent
 		 (gnus-online method)
 		 (gnus-check-backend-function 'request-scan (car method)))
-	(gnus-request-scan nil method))
+	(if infos
+	    (dolist (info infos)
+	      (gnus-request-scan (gnus-info-group info) method))
+	  (gnus-request-scan nil method)))
       (cond
        ((and (eq gnus-read-active-file 'some)
 	     (gnus-check-backend-function 'retrieve-groups (car method))