From 7280feff116a662645fac9e08de3aef8403b780e Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Tue, 29 Mar 2011 11:09:22 -0500 Subject: [PATCH] Ignore "archive:sent" groups. Bail out early if enough matches are found while tracking the sender (the slowest registry search). * 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 | 9 +++++++++ lisp/gnus-registry.el | 40 +++++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad8cf6e59..59eb9d561 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2011-03-29 Teodor Zlatanov + + * 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 * message.el (message--yank-original-internal): New function to do the diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index cef173ce1..db3cc06e9 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -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 -- 2.34.1