diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 50eeb3efa3..c9f7491d5b 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -20394,6 +20394,36 @@ Score File Format @end enumerate @cindex score file atoms +@item score-fn +The value of this entry should be one or more user-defined function +names in parentheses. Each function will be called in order and the +returned value is required to be an integer. + +@example + (score-fn (custom-scoring)) +@end example + +The user-defined function is called with an associative list with the +keys @code{number subject from date id refs chars lines xref extra} +followed by the article's score before the function is run. + +The following (somewhat contrived) example shows how to use a +user-defined function that increases an article's score by 10 if the +year of the article's date is also mentioned in its subject. + +@example + (defun custom-scoring (article-alist score) + (let ((subject (cdr (assoc 'subject article-alist))) + (date (cdr (assoc 'date article-alist)))) + (if (string-match (number-to-string + (nth 5 (parse-time-string date))) + subject) + 10))) +@end example + +@code{score-fn} entries are permanent and can only be added or +modified directly in the @code{SCORE} file. + @item mark The value of this entry should be a number. Any articles with a score lower than this number will be marked as read.