Agent Categories The Category Buffer
A category consists of two things.
A predicate consists of predicates with logical operators sprinkled in between.
Perhaps some examples are in order.
Here's a simple predicate. (It's the default predicate, in fact, used for all groups that don't belong to any other category.)
short
Quite simple, eh? This predicate is true if and only if the article is short (for some value of ``short'').
Here's a more complex predicate:
(or high (and (not low) (not long)))
This means that an article should be downloaded if it has a high score, or if the score is not low and the article is not long. You get the drift.
The available logical operators are or
, and
and
not
. (If you prefer, you can use the more ``C''-ish operators
`|
', &
and !
instead.)
The following predicates are pre-defined, but if none of these fit what you want to do, you can write your own.
short
|
True iff the article is shorter than |
long
|
True iff the article is longer than |
low
|
True iff the article has a download score less than
|
high
|
True iff the article has a download score greater than
|
spam
|
True iff the Gnus Agent guesses that the article is spam. The heuristics may change over time, but at present it just computes a checksum and sees whether articles match. |
true
|
Always true. |
false
|
Always false. |
If you want to create your own predicate function, here's what you have
to know: The functions are called with no parameters, but the
gnus-headers
and gnus-score
dynamic variables are bound to
useful values.
Now, the syntax of the download score is the same as the syntax of
normal score files, except that all elements that require actually
seeing the article itself are verboten. This means that only the
following headers can be scored on: From
, Subject
,
Date
, Xref
, Lines
, Chars
, Message-ID
,
and References
.