Gnus Manual. Node: Category Syntax

prev UPAgent Categories NEXTThe Category Buffer

6.6.2.1: Category Syntax

A category consists of two things.

  1. A predicate which (generally) gives a rough outline of which articles are eligible for downloading; and
  2. a score rule which (generally) gives you a finer granularity when deciding what articles to download. (Note that this download score is wholly unrelated to normal scores.)

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 gnus-agent-short-article lines; default 100.

long

True iff the article is longer than gnus-agent-long-article lines; default 200.

low

True iff the article has a download score less than gnus-agent-low-score; default 0.

high

True iff the article has a download score greater than gnus-agent-high-score; default 0.

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.

prev UPAgent Categories NEXTThe Category Buffer