2001-02-06 21:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 7 Feb 2001 03:01:12 +0000 (03:01 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 7 Feb 2001 03:01:12 +0000 (03:01 +0000)
* gnus-group.el (gnus-group-listing-limit): New.
(gnus-group-prepare-flat-list-dead): Use old trick to speed up.

* gnus-topic.el (gnus-group-prepare-topics): Use gnus-killed-hashtb.

lisp/ChangeLog
lisp/gnus-group.el
lisp/gnus-topic.el

index 1918270..ce0ba10 100644 (file)
@@ -1,3 +1,10 @@
+2001-02-06 21:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-group.el (gnus-group-listing-limit): New.
+       (gnus-group-prepare-flat-list-dead): Use old trick to speed up.
+
+       * gnus-topic.el (gnus-group-prepare-topics): Use gnus-killed-hashtb.
+
 2001-02-06 18:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-newline-and-reformat): Special case for
index 0c56fdf..f497437 100644 (file)
@@ -429,6 +429,11 @@ in the minibuffer prompt."
   :type '(choice (string :tag "Prompt string")
                  (const :tag "Empty" nil)))
 
+(defvar gnus-group-listing-limit 1000
+  "*A limit of the number of groups when listing.
+If the number of groups is larger than the limit, list them in a
+simple manner.")
+
 ;;; Internal variables
 
 (defvar gnus-group-sort-alist-function 'gnus-group-sort-flat
@@ -1187,32 +1192,40 @@ if it is a string, only list groups matching REGEXP."
   ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.  It does
   ;; this by ignoring the group format specification altogether.
   (let (group)
-    (while groups
-      (setq group (pop groups))
-      (when (gnus-group-prepare-logic
-            group
-            (or (not regexp)
-                (and (stringp regexp) (string-match regexp group))
-                (and (functionp regexp) (funcall regexp group))))
-;;;    (gnus-add-text-properties
-;;;     (point) (prog1 (1+ (point))
-;;;               (insert " " mark "     *: "
-;;;                       (gnus-group-name-decode group
-;;;                                               (gnus-group-name-charset
-;;;                                                nil group))
-;;;                       "\n"))
-;;;     (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
-;;;           'gnus-unread t
-;;;           'gnus-level level))
-       (gnus-group-insert-group-line
-        group level nil
-        (let ((active (gnus-active group)))
-          (if active
-              (if (zerop (cdr active))
-                  0
-                (- (1+ (cdr active)) (car active)))
-            nil))
-        (gnus-method-simplify (gnus-find-method-for-group group)))))))
+    (if (> (length groups) gnus-group-listing-limit)
+       (while groups
+         (setq group (pop groups))
+         (when (gnus-group-prepare-logic
+                group
+                (or (not regexp)
+                    (and (stringp regexp) (string-match regexp group))
+                    (and (functionp regexp) (funcall regexp group))))
+           (gnus-add-text-properties
+            (point) (prog1 (1+ (point))
+                      (insert " " mark "     *: "
+                              (gnus-group-name-decode group
+                                                      (gnus-group-name-charset
+                                                       nil group))
+                              "\n"))
+            (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
+                  'gnus-unread t
+                  'gnus-level level))))
+      (while groups
+       (setq group (pop groups))
+       (when (gnus-group-prepare-logic
+              group
+              (or (not regexp)
+                  (and (stringp regexp) (string-match regexp group))
+                  (and (functionp regexp) (funcall regexp group))))
+         (gnus-group-insert-group-line
+          group level nil
+          (let ((active (gnus-active group)))
+            (if active
+                (if (zerop (cdr active))
+                    0
+                  (- (1+ (cdr active)) (car active)))
+              nil))
+          (gnus-method-simplify (gnus-find-method-for-group group))))))))
 
 (defun gnus-group-update-group-line ()
   "Update the current line in the group buffer."
index adfd13a..e242312 100644 (file)
@@ -421,14 +421,17 @@ If LOWEST is non-nil, list all newsgroups of level LOWEST or higher."
               (and (>= level gnus-level-killed)
                    (<= lowest gnus-level-killed)))
       (gnus-group-prepare-flat-list-dead
-       (gnus-union
-       (and not-in-list
-            (gnus-delete-if (lambda (group)
-                              (< (gnus-group-level group) gnus-level-killed))
-                            not-in-list))
-       (setq gnus-killed-list (sort gnus-killed-list 'string<)))
-       gnus-level-killed ?K
-       regexp))
+       (setq gnus-killed-list (sort gnus-killed-list 'string<))
+       gnus-level-killed ?K regexp)
+      (when not-in-list
+       (unless gnus-killed-hashtb
+         (gnus-make-hashtable-from-killed))
+       (gnus-group-prepare-flat-list-dead
+        (gnus-delete-if (lambda (group)
+                          (or (gnus-gethash group gnus-newsrc-hashtb)
+                              (gnus-gethash group gnus-killed-hashtb)))
+                        not-in-list)
+        gnus-level-killed ?K regexp)))
 
     ;; Use topics.
     (prog1