On Wed, 03 Jul 2013 10:07:09 +0200 Tassilo Horn <[email protected]> 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
_______________________________________________
info-gnus-english mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to