(gnus-decay-scores, gnus-score-load-file): Allow
authorReiner Steib <Reiner.Steib@gmx.de>
Mon, 3 Jan 2005 16:05:14 +0000 (16:05 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Mon, 3 Jan 2005 16:05:14 +0000 (16:05 +0000)
to apply decay on score files matching a regexp.

lisp/ChangeLog
lisp/gnus-score.el

index 8e3dc4e..7270d5e 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-03  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * gnus-score.el (gnus-decay-scores, gnus-score-load-file): Allow
+       to apply decay on score files matching a regexp.
+
 2004-12-30  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-group.el (gnus-group-line-format-alist): Keep the forward
index 9c061ab..5a7e79b 100644 (file)
@@ -145,6 +145,17 @@ will be expired along with non-matching score entries."
   :group 'gnus-score-expire
   :type 'boolean)
 
+(defcustom gnus-decay-scores nil
+  "*If non-nil, decay non-permanent scores.
+
+If it is a regexp, only decay score files matching regexp."
+  :group 'gnus-score-decay
+  :type `(choice (const :tag "never" nil)
+                (const :tag "always" t)
+                (const :tag "adaptive score files"
+                       ,(concat "\\." gnus-adaptive-file-suffix "\\'"))
+                (regexp)))
+
 (defcustom gnus-decay-scores nil
   "*If non-nil, decay non-permanent scores."
   :group 'gnus-score-decay
@@ -1210,7 +1221,9 @@ If FORMAT, also format the current score file."
          (decay (car (gnus-score-get 'decay alist)))
          (eval (car (gnus-score-get 'eval alist))))
       ;; Perform possible decays.
-      (when (and gnus-decay-scores
+      (when (and (if (stringp gnus-decay-scores)
+                    (string-match gnus-decay-scores file)
+                  gnus-decay-scores)
                 (or cached (file-exists-p file))
                 (or (not decay)
                     (gnus-decay-scores alist decay)))