Ignore "archive:sent" groups. Bail out early if enough matches are found while track...
authorTed Zlatanov <tzz@lifelogs.com>
Tue, 29 Mar 2011 16:09:22 +0000 (11:09 -0500)
committerTed Zlatanov <tzz@lifelogs.com>
Tue, 29 Mar 2011 16:09:22 +0000 (11:09 -0500)
* gnus-registry.el (gnus-registry-unfollowed-groups): Add
"archive:sent" to the unfollowed group regex (for the recent Gnus
archive:sent-YYYY-MM-DD groups).
(gnus-registry-split-fancy-with-parent): Bail out early in sender
tracking if there are more than `gnus-registry-max-track-groups'
matches.

lisp/ChangeLog
lisp/gnus-registry.el

index ad8cf6e..59eb9d5 100644 (file)
@@ -1,3 +1,12 @@
+2011-03-29  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnus-registry.el (gnus-registry-unfollowed-groups): Add
+       "archive:sent" to the unfollowed group regex (for the recent Gnus
+       archive:sent-YYYY-MM-DD groups).
+       (gnus-registry-split-fancy-with-parent): Bail out early in sender
+       tracking if there are more than `gnus-registry-max-track-groups'
+       matches.
+
 2011-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * message.el (message--yank-original-internal): New function to do the
index cef173c..db3cc06 100644 (file)
@@ -124,7 +124,7 @@ display."
   :type 'symbol)
 
 (defcustom gnus-registry-unfollowed-groups
-  '("delayed$" "drafts$" "queue$" "INBOX$" "^nnmairix:")
+  '("delayed$" "drafts$" "queue$" "INBOX$" "^nnmairix:" "archive")
   "List of groups that gnus-registry-split-fancy-with-parent won't return.
 The group names are matched, they don't have to be fully
 qualified.  This parameter tells the Registry 'never split a
@@ -541,24 +541,26 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
                       user-mail-address)))
       (maphash
        (lambda (key value)
-        (let ((this-sender (cdr
-                            (gnus-registry-fetch-extra key 'sender)))
-              matches)
-          (when (and this-sender
-                     (equal sender this-sender))
-            (let ((groups (gnus-registry-fetch-groups
-                           key
-                           gnus-registry-max-track-groups)))
-              (dolist (group groups)
-                (when (and group (gnus-registry-follow-group-p group))
-                  (push group found-full)
-                  (setq found (append (list group) (delete group found))))))
-            (push key matches)
-            (gnus-message
-             ;; raise level of messaging if gnus-registry-track-extra
-             (if gnus-registry-track-extra 7 9)
-             "%s (extra tracking) traced sender %s to groups %s (keys %s)"
-             log-agent sender found matches))))
+         ;; don't use more than gnus-registry-max-track-groups
+         (when (< (length found-full) gnus-registry-max-track-groups)
+           (let ((this-sender
+                  (cdr (gnus-registry-fetch-extra key 'sender)))
+                 matches)
+             (when (and this-sender
+                        (equal sender this-sender))
+               (let ((groups (gnus-registry-fetch-groups
+                              key
+                              gnus-registry-max-track-groups)))
+                 (dolist (group groups)
+                   (when (and group (gnus-registry-follow-group-p group))
+                     (push group found-full)
+                     (setq found (append (list group) (delete group found))))))
+               (push key matches)
+               (gnus-message
+                ;; raise level of messaging if gnus-registry-track-extra
+                (if gnus-registry-track-extra 7 9)
+                "%s (extra tracking) traced sender %s to groups %s (keys %s)"
+                log-agent sender found matches)))))
        gnus-registry-hashtb)
       ;; filter the found groups and return them
       ;; the found groups are NOT the full groups