From d20acfe06340953dce443795d28ac224a2223414 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Thu, 18 Dec 2014 11:22:02 +0000 Subject: Fix Gnus registry pruning and sorting, and rename file * lisp/gnus/gnus-registry.el (gnus-registry-prune-factor): Add new variable. (gnus-registry-max-pruned-entries): Remove obsolete variable. (gnus-registry-cache-file): Change default filename extension to "eieio". (gnus-registry-read): Add new function, split out from `gnus-registry-load', that does the actual object reading. (gnus-registry-load): Use it. Add condition case handler to check for old filename extension and rename to the new one. (gnus-registry-default-sort-function): New variable to specify a sort function to use when pruning. (gnus-registry-save, gnus-registry-insert): Use it. (gnus-registry-sort-by-creation-time): Define a default sort function. * lisp/gnus/registry.el (registry-db): Consolidate the :max-hard and :max-soft slots into a :max-size slot. (registry-db-version): Add new variable for database version number. (registry-prune): Use :max-size slot. Accept and use a sort-function argument. (registry-collect-prune-candidates): Add new function for finding non-precious pruning candidates. (registry-prune-hard-candidates, registry-prune-soft-candidates): Remove obsolete functions. (initialize-instance): Upgrade registry version when starting. * doc/misc/gnus.texi (Gnus Registry Setup): Explain pruning changes. Mention gnus-registry-prune-factor. Explain sorting changes and gnus-registry-default-sort-function. Correct file extension. --- doc/misc/ChangeLog | 6 ++++++ doc/misc/gnus.texi | 27 ++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 76b530393f5..cd8b7f34ee6 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-18 Eric Abrahamsen + + * gnus.texi (Gnus Registry Setup): Explain pruning changes. Mention + gnus-registry-prune-factor. Explain sorting changes and + gnus-registry-default-sort-function. Correct file extension. + 2014-12-17 Jay Belanger * calc.texi (About This Manual): Update instructions diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 57aee27e2b1..6e3dced25d4 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -25953,17 +25953,34 @@ the word ``archive'' is not followed. @defvar gnus-registry-max-entries The number (an integer or @code{nil} for unlimited) of entries the -registry will keep. +registry will keep. If the registry has reached or exceeded this +size, it will reject insertion of new entries. @end defvar -@defvar gnus-registry-max-pruned-entries -The maximum number (an integer or @code{nil} for unlimited) of entries -the registry will keep after pruning. +@defvar gnus-registry-prune-factor +This option (a float between 0 and 1) controls how much the registry +is cut back during pruning. In order to prevent constant pruning, the +registry will be pruned back to less than +@code{gnus-registry-max-entries}. This option controls exactly how +much less: the target is calculated as the maximum number of entries +minus the maximum number times this factor. The default is 0.1: +i.e. if your registry is limited to 50000 entries, pruning will try to +cut back to 45000 entries. Entries with keys marked as precious will +not be pruned. +@end defvar + +@defvar gnus-registry-default-sort-function +This option specifies how registry entries are sorted during pruning. +If a function is given, it should sort least valuable entries first, +as pruning starts from the beginning of the list. The default value +is @code{gnus-registry-sort-by-creation-time}, which proposes the +oldest entries for pruning. Set to nil to perform no sorting, which +will speed up the pruning process. @end defvar @defvar gnus-registry-cache-file The file where the registry will be stored between Gnus sessions. By -default the file name is @code{.gnus.registry.eioio} in the same +default the file name is @code{.gnus.registry.eieio} in the same directory as your @code{.newsrc.eld}. @end defvar -- cgit v1.2.1