info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some Gnus Registry questions


From: Ted Zlatanov
Subject: Re: Some Gnus Registry questions
Date: Mon, 08 Jul 2013 08:15:34 -0400
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

On Wed, 03 Jul 2013 10:07:09 +0200 Tassilo Horn <tsdh@gnu.org> wrote: 

TH> Thanks.  I've come up with this, and it seems to work:
TH> (defun gnus-registry-remove-extra-data (extra)
TH>   "Remove tracked EXTRA data from the gnus registry.
TH> EXTRA is a list of symbols.  Valid symbols are those contained in
TH> the docs of `gnus-registry-track-extra'.  This command is useful
TH> if you stop tracking some extra data and now want to purge it
TH> from your existing entries."
TH>   (interactive (list (mapcar 'intern
TH>                          (completing-read-multiple
TH>                           "Extra data: "
TH>                           '("subject" "sender" "recipient")))))
TH>   (when extra
TH>     (let ((db gnus-registry-db))
TH>       (registry-reindex db)
TH>       (loop for k being the hash-keys of (oref db :data)
TH>         using (hash-value v)
TH>         do (let ((newv (cl-remove-if #'(lambda (entry)
TH>                                          (member (car entry) extra))
TH>                                      v)))
TH>              (registry-delete db (list k) nil)
TH>              (gnus-registry-insert db k newv)))
TH>       (registry-reindex db))))

TH> However, it didn't shrink the size of the registry that much (reduced
TH> the size by about one fourth).

TH> Anyway, I think it's useful.  Should I add it to gnus-registry.el?  (I
TH> guess I'll have to remove the `cl-remove-if' to stay compatible with
TH> older emacsen...)

Yes, please, and do what you can for older Emacsen... we can rewrite
that code altogether in a Gnus helper function if necessary.

Ted


reply via email to

[Prev in Thread] Current Thread [Next in Thread]