Gnus development mailing list
 help / color / mirror / Atom feed
From: Sam Steingold <sds@gnu.org>
To: ding@gnus.org
Subject: scoring role for all but a few groups
Date: Tue, 07 Jan 2020 11:58:42 -0500	[thread overview]
Message-ID: <m15zhnjj99.fsf@gnu.org> (raw)

Hi,
I have a couple of scoring rules that I want to be applied to _all_
groups _except_ for a handful of others.

(e.g., kill all non-ASCII subjects _except_ for 1 non-ASCII group or
up-score new threads _except_ for groups like reddit and slashdot where
_every_ message is a new thread).

I tried adding the general rule into the global score file and the
opposite rule into the file relevant only to the "except" groups, but it
did not work (https://debbugs.gnu.org/db/36/36697.html).

It looks like I have to put the rule

--8<---------------cut here---------------start------------->8---
(("references" ("" 1000 nil e))) ; new thread
--8<---------------cut here---------------end--------------->8---

into a separate file `new-thread` and this

--8<---------------cut here---------------start------------->8---
(add-hook 'gnus-score-find-score-files-function 'sds-gnus-upscore-new-thread)
(defun sds-gnus-upscore-new-thread (group)
  (and (not (string-match "\\.\\(news\\|slashdot\\|announce\\)" group)) '("new-thread")))
--8<---------------cut here---------------end--------------->8---

to `.emacs`

This seems like an ugly solution
(at the very least I wish I could put the rules in the function body,
but it does not work despite the doc saying it should).

Any better suggestions?

Thanks!

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1671
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
https://thereligionofpeace.com http://think-israel.org https://ffii.org
XML is like violence. If it doesn't solve the problem, use more.




                 reply	other threads:[~2020-01-07 16:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m15zhnjj99.fsf@gnu.org \
    --to=sds@gnu.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).