Ted Zlatanov writes: > On Sat, 08 Nov 2014 16:39:48 +0800 Eric Abrahamsen wrote: > > EA> So unless I'm really missing something, my proposal is: > > EA> 1. Only provide one limit: max-size. > EA> 2. Allow customization of prune-factor. > > EA> That seems like all the customization you'd need. Cap the size, and > EA> provide a reasonable control of how often the registry gets pruned. > > OK. I am afraid I made the whole thing too complicated and it took > another set of eyes to recognize it. Thanks for that, and the fixes. > > Please go ahead and apply any changes you have in mind. I am sure no one > is tuning soft/hard pruning. Simpler is definitely better. > > EA> That would require a change in the object signature, which would mean > EA> some extra handling code for "upgrading". But once we're doing that, we > EA> could also take the opportunity to add :prune-function and > EA> :sort-function slots on the base registry object, which would be > EA> nice. We could even change the default store filename from its "eioio" > EA> extension to "eieio". :) > > Yeah, I remember that bug report about the extension of the database > file, if we're upgrading anyway... It's a good chance to batch these > changes. Okay, here is Stab the First. Most of what's happening should be evident from commit messages and code comments. There are three patches: 1. The big one changes the database structure, combining :max-hard and :max-soft into :max-size, and reworking the pruning routine to only make a single pass. This also includes a new initialize-instance method for upgrading from older versions, and the extraction of the database version into a new defvar: see the comments on top of `registry-db-version'. 2. The second patch changes the default filename to a eieio extension, which necessitated more code than I thought -- `gnus-registry-read' is split into two functions. I hope this isn't too crufty. 3. Number three introduces sorting into the pruning process. I considered adding a sorting function as a slot on the registry-db objects, but couldn't immediately think of why that was really necessary. Anyway, there's a new option `gnus-registry-default-sorting-function', which defaults to a function that sorts by 'creation-time. Tests and documentation all around. Presumably there are bugs! I hope people will test. Eric