4.3 Adding Rules Interactively

Initially, elfeed-score rules were hand-authored by the user in The Score File; the workflow being:

  1. Hand edit the score file.
  2. Re-load the score file via elfeed-score-load-score-file.
  3. Re-score the current search via elfeed-score-score-search.

The 0.8 releases introduced interactive scoring. In the Elfeed search buffer, or the Elfeed show buffer, one can now add a new rule based on the current entry through an Emacs command elfeed-score-main-add-*-rule.

Most rules have a number of attributes, and it would be onerous to have to supply them each time one of these commands is invoked. Therefore these commands obey a set of customizable variables that will, in the general case, supply defaults:

User Option: elfeed-score-maint-default-match-type

The default match type for interactively added rules (one of ’s, ’S, ’r, ’R, ’w or ’W).

User Option: elfeed-score-maint-default-scope-to-feed

Governs whether the interactively added rule is scoped to the entry’s feed. May be one of ’yes, ’no or ’ask.

User Option: elfeed-score-maint-default-scope-to-tags

Governs whether the interactively added rule is scoped to the entry’s tags (when applicable). May be one of ’yes, ’no or ’ask.

User Option: elfeed-score-maint-default-feed-attribute

Default feed attribute against which an interactively added feed rule will be matched. May be one of ’t, ’u, or ’a for title, URL or author, respectively.

These rules can be invoked in a few ways:

The functions for adding rules interactively:

Command: elfeed-score-maint-add-title-rule value

Add a title rule based on the current entry. The default value for the match text will be the current entry’s title.

Command: elfeed-score-maint-add-content-rule value

Add a content rule based on the current entry. This may only be invoked when displaying an Elfeed entry. If the region is active, the default match text will be the selection. Otherwise, the default match text will be the entry’s contents.

Command: elfeed-score-maint-add-feed-rule value

Add a feed rule based on the current entry.

Command: elfeed-score-maint-add-authors-rule value

Add an authors rule based on the current entry.

Command: elfeed-score-maint-add-tag-rule value

Add a tag rule based on the current entry.

Add a link rule based on the current entry.

Command: elfeed-score-maint-add-title-or-content-rule title-value content-value

Add a title-or-content rule based on the current entry. If displaying an entry, and the region is active, the default match text will be the selection. Otherwise, it will be the entry text.