A score file is an
emacs-lisp file that normally contains just a
single form. Casual users are not expected to edit these files;
everything can be changed from the summary buffer.
Anyway, if you'd like to dig into it yourself, here's an example:
(("from" ("Lars Ingebrigtsen" -10000) ("Per Abrahamsen") ("larsi\\|lmi" -50000 nil R)) ("subject" ("Ding is Badd" nil 728373)) ("xref" ("alt.politics" -1000 728372 s)) ("lines" (2 -100 nil <)) (mark 0) (expunge -1000) (mark-and-expunge -10) (read-only nil) (orphan -10) (adapt t) (files "/hom/larsi/News/gnu.SCORE") (exclude-files "all.SCORE") (local (gnus-newsgroup-auto-expire t) (gnus-summary-make-false-root empty)) (eval (ding)))
This example demonstrates most score file elements. See Advanced Scoring, for a different approach.
Even though this looks much like Lisp code, nothing here is actually
evaled. The Lisp reader is used to read this form, though, so it
has to be valid syntactically, if not semantically.
Six keys are supported by this alist:
Date. In addition to these headers, there are three strings to tell Gnus to fetch the entire article and do the match on larger parts of the article:
Bodywill perform the match on the body of the article,
Headwill perform the match on the head of the article, and
Allwill perform the match on the entire article. Note that using any of these last three keys will slow down group entry considerably. The final “header” you can score on is
Followup. These score entries will result in new score entries being added for all follow-ups to articles that matches these score entries.
Following this key is an arbitrary number of score entries, where each score entry has one to four elements.
gnus-score-interactive-default-scorenumber will be used instead. This is 1000 by default.
R(regexp), as well as
S(substring) types, and
E(exact match), and
w(word match) types. If this element is not present, Gnus will assume that substring matching should be used.
Ediffer from the others in that the matches will be done in a case-sensitive manner. All these one-letter types are really just abbreviations for the
wordtypes, which you can use instead, if you feel like.
("111.222.333.444" -1000 nil s "NNTP-Posting-Host")
These predicates are true if
(PREDICATE HEADER MATCH)
evaluates to non-
nil. For instance, the advanced match
("lines" 4 <) (see Advanced Scoring) will result in the
(< header-value 4)
Or to put it another way: When using
Lines with 4 as
the match, we get the score added if the article has less than 4 lines.
(It's easy to get confused and think it's the other way around. But
it's not. I think.)
When matching on
Lines, be careful because some back ends (like
nndir) do not generate
Lines header, so every article ends
up being marked as having 0 lines. This can lead to strange results if
you happen to lower score of the articles with few lines.
after. I can't really imagine this ever being useful, but, like, it would feel kinda silly not to provide this function. Just in case. You never know. Better safe than sorry. Once burnt, twice shy. Don't judge a book by its cover. Never not have sex on a first date. (I have been told that at least one person, and I quote, “found this function indispensable”, however.)
A more useful match type is
regexp. With it, you can match the
date string using a regular expression. The date is normalized to
ISO8601 compact format first—YYYYMMDD
you want to match all articles that have been posted on April 1st in
every year, you could use ‘....0401.........’ as a match string,
for instance. (Note that the date is kept in its original time zone, so
this will match articles that were posted when it was April 1st where
the article was posted from. Time zones are such wholesome fun for the
whole family, eh?)
From(etc.) header uses.
Fromheader, and affect the score of not only the matching articles, but also all followups to the matching articles. This allows you to increase the score of followups to your own articles, or decrease the score of followups to the articles of some known trouble-maker. Uses the same match types as the
Fromheader uses. (Using this match key will lead to creation of ADAPT files.)
Followupmatch key. If you say that you want to score on a (sub-)thread started by an article with a
Message-IDx, then you add a ‘thread’ match. This will add a new ‘thread’ match for each article that has x in its
Referencesheader. (These new ‘thread’ matches will use the
Message-IDs of these matching articles.) This will ensure that you can raise/lower the score of an entire thread, even though some articles in the thread may not have complete
Referencesheaders. Note that using this may lead to nondeterministic scores of the articles in the thread. (Using this match key will lead to creation of ADAPT files.)
gnus-thread-score-functionsays how to compute the total score for a thread.
evaled. This element will be ignored when handling global score files.
You can do this with the following two score file entries:
(orphan -500) (mark-and-expunge -100)
When you enter the group the first time, you will only see the new threads. You then raise the score of the threads that you find interesting (with I T or I S), and ignore (c y) the rest. Next time you enter the group, you will see new articles in the interesting threads, plus any new threads.
I.e., the orphan score atom is for high-volume groups where a few
interesting threads which can't be found automatically by ordinary
scoring rules exist.
t, the default adaptive scoring rules will be used. If it is
ignore, no adaptive scoring will be performed on this group. If it is a list, this list will be used as the adaptive scoring rules. If it isn't present, or is something other than
ignore, the default adaptive scoring rules will be used. If you want to use adaptive scoring on most groups, you'd set
t, and insert an
(adapt ignore)in the groups where you do not want adaptive scoring. If you only want adaptive scoring in a few groups, you'd set
nil, and insert
(adapt t)in the score files of the groups where you want it.
)pairs. Each var will be made buffer-local to the current summary buffer, and set to the value specified. This is a convenient, if somewhat strange, way of setting variables in some groups if you don't like hooks much. Note that the value won't be evaluated.