From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/16370 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.user Subject: Re: Some Gnus Registry questions Date: Wed, 03 Jul 2013 10:07:09 +0200 Message-ID: <87obakvzgy.fsf@thinkpad.tsdh.de> References: <87k3m2ihdx.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1372838845 24952 80.91.229.3 (3 Jul 2013 08:07:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2013 08:07:25 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Wed Jul 03 10:07:26 2013 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UuI61-0006v6-AS for gegu-info-gnus-english@m.gmane.org; Wed, 03 Jul 2013 10:07:25 +0200 Original-Received: from localhost ([::1]:49701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuI60-00035w-PG for gegu-info-gnus-english@m.gmane.org; Wed, 03 Jul 2013 04:07:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuI5x-00035q-KW for info-gnus-english@gnu.org; Wed, 03 Jul 2013 04:07:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuI5w-0001hi-3r for info-gnus-english@gnu.org; Wed, 03 Jul 2013 04:07:21 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuI5v-0001fK-TR for info-gnus-english@gnu.org; Wed, 03 Jul 2013 04:07:20 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UuI5u-0006ou-Kw for info-gnus-english@gnu.org; Wed, 03 Jul 2013 10:07:18 +0200 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Jul 2013 10:07:18 +0200 Original-Received: from tsdh by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Jul 2013 10:07:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 64 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:iBkjZw9zx16+EpDhLzZDpYm3ioA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:16370 Archived-At: Ted Zlatanov writes: > On Thu, 13 Jun 2013 08:08:40 +0200 Tassilo Horn wrote: > > TH> Ok, so now I've set gnus-registry-track-extra to nil in order to make > TH> the registry only track message ids. That works fine for new articles, > TH> but is there a way to remove the sender, recipients, and subjects from > TH> old articles that are already contained in the registry? > > TH> `gnus-registry-remake-db' looks like it will erase all information, so > TH> I've not tried that so far. > > I have definitely not needed this so far :) > > You can probably write it starting with `gnus-registry-remove-ignored' > for the iteration across all articles and for each article, do something > like this (untested): > > (defun gnus-registry-remove-id-key (id key) > (let ((db gnus-registry-db) > (entry (gnus-registry-get-or-make-entry id))) > (registry-delete db (list id) nil) > (setq entry (assq-delete-all key entry)) > (gnus-registry-insert db id entry) > entry)) > > where `key' is 'subject for example. If that works for you, I can add > both a more generic iteration and the remove function above. Thanks. I've come up with this, and it seems to work: --8<---------------cut here---------------start------------->8--- (defun gnus-registry-remove-extra-data (extra) "Remove tracked EXTRA data from the gnus registry. EXTRA is a list of symbols. Valid symbols are those contained in the docs of `gnus-registry-track-extra'. This command is useful if you stop tracking some extra data and now want to purge it from your existing entries." (interactive (list (mapcar 'intern (completing-read-multiple "Extra data: " '("subject" "sender" "recipient"))))) (when extra (let ((db gnus-registry-db)) (registry-reindex db) (loop for k being the hash-keys of (oref db :data) using (hash-value v) do (let ((newv (cl-remove-if #'(lambda (entry) (member (car entry) extra)) v))) (registry-delete db (list k) nil) (gnus-registry-insert db k newv))) (registry-reindex db)))) --8<---------------cut here---------------end--------------->8--- However, it didn't shrink the size of the registry that much (reduced the size by about one fourth). Anyway, I think it's useful. Should I add it to gnus-registry.el? (I guess I'll have to remove the `cl-remove-if' to stay compatible with older emacsen...) Bye, Tassilo