summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Zlatanov <tzz@lifelogs.com>2011-06-01 22:35:26 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-06-01 22:35:26 +0000
commit8d009f4aa92f21b53eed6b6d2433e913d8c09647 (patch)
tree9d126a6927a6f3ab5ebbabebfa68f135746be4c0
parent698d32e2c326871239dc0cb10659a0ecb25bf558 (diff)
downloademacs-8d009f4aa92f21b53eed6b6d2433e913d8c09647.tar.gz
gnus-registry.el (gnus-registry-remove-ignored): New function to remove entries with groups we ignore.
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-registry.el14
2 files changed, 19 insertions, 0 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 4cf21f65597..ff3eb98bb97 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-01 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * gnus-registry.el (gnus-registry-remove-ignored): New function to
+ remove entries with groups we ignore.
+
2011-05-31 Lars Magne Ingebrigtsen <larsi@gnus.org>
* shr.el (shr-rescale-image): Add an :ascent of 100 to images so that
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index f6c0daaaa93..a44986e2499 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -321,6 +321,20 @@ This is not required after changing `gnus-registry-cache-file'."
(gnus-message 5 "Saving Gnus registry (size %d) to %s...done"
(registry-size db) file)))
+(defun gnus-registry-remove-ignored ()
+ (interactive)
+ (let* ((db gnus-registry-db)
+ (grouphashtb (registry-lookup-secondary db 'group))
+ (old-size (registry-size db)))
+ (registry-reindex db)
+ (loop for k being the hash-keys of grouphashtb
+ using (hash-values v)
+ when (gnus-registry-ignore-group-p k)
+ do (registry-delete db v nil))
+ (registry-reindex db)
+ (gnus-message 4 "Removed %d ignored entries from the Gnus registry"
+ (- old-size (registry-size db)))))
+
;; article move/copy/spool/delete actions
(defun gnus-registry-action (action data-header from &optional to method)
(let* ((id (mail-header-id data-header))