Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: info-gnus-english@gnu.org
Subject: Re: Some Gnus Registry questions
Date: Mon, 08 Jul 2013 08:15:34 -0400	[thread overview]
Message-ID: <87a9lxz1qx.fsf@lifelogs.com> (raw)
In-Reply-To: <mailman.116.1372838844.12400.info-gnus-english@gnu.org>

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

  parent reply	other threads:[~2013-07-08 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.23938.1365663121.855.info-gnus-english@gnu.org>
2013-06-10  4:21 ` Ted Zlatanov
2013-06-10  6:55   ` Tassilo Horn
2013-06-13  6:08     ` Tassilo Horn
     [not found]     ` <mailman.1516.1371103738.22516.info-gnus-english@gnu.org>
2013-06-16  9:17       ` Ted Zlatanov
2013-07-03  8:07         ` Tassilo Horn
     [not found]         ` <mailman.116.1372838844.12400.info-gnus-english@gnu.org>
2013-07-08 12:15           ` Ted Zlatanov [this message]
2013-04-11  6:51 Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9lxz1qx.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).