Gnus development mailing list
 help / color / mirror / Atom feed
From: Sudish Joseph <sudish@mindspring.com>
Subject: Re: score files...
Date: 12 Aug 1996 00:17:50 -0400	[thread overview]
Message-ID: <m2ivapz15d.fsf@atreides.erehwon.org> (raw)
In-Reply-To: Jack Vinson's message of 11 Aug 1996 18:16:06 -0400

In article <wo4tm9tvmh.fsf@cheux.ecs.umass.edu>,
Jack Vinson <jvinson@cheux.ecs.umass.edu> writes:
>>>>>> <robert@elastica.com> writes:
>> Actually on further review it looks like comp.lang.java.SCORE matches the
>> entire hierarchy.

> Isn't this incorrect?  group.SCORE should only match the group in question,
> should it not?  group.all.SCORE will match group and any hierarchy under
> group.  This is what you wanted, I think.

>From what I recall, the match isn't anchored and you'll get a hit on a
substring.  So, emacs.SCORE would match any of gnus.emacs.gnus, 
comp.emacs.xemacs and alt.religion.emacs.  Hmm, this might have
changed.  Lars?

> This may be related to something I noticed a while back when grokking
> through various 'forsale' groups.  There is a forsale.stuff hierarchy and
> various other foo.bar.forsale groups.  I thought I was going to need
> forsale.all.SCORE to match the first groups and all.forsale.SCORE to match
> the second groups.  It turns out that the former form matches both sets of
> groups.  Is this the correct behavior as well?

Sure, if the match isn't anchored.

Being able to separate the name of the score file from the criterion
used to select the score file is useful in itself...this is why I
added gnus-score-file-{single|multiple}-match-alist.  I guess no one
uses it because the only notification was a Changelog entry somewhere
in the ding.x series.

The match is a regexp and you may match any part of the group name
using any regexp you like.  Using the `files' directive isn't quite so
flexible, since you still need to ensure that the file containing the
directive gets loaded.

You can play funky tricks by making the filename a regexp as Lars
pointed out recently.  So, if you wanted a score file for the news.*
heirarchy, you might use "^news.SCORE" as the name of the file name.
I prefer adding ("^news" "News.score") to the -match-alists.

The main problem with all this is that you still need to ensure that
score entries go into the right file.  For e.g., I'd like all scoring
I do in any group on emacs to go into Emacs.SCORE, irrespective of
where the word emacs occurs in the groupname.  

This is difficult (but !impossible :-) to do without providing a
mapping from group to filename.  If you use the -match-alist's, you
get the mapping for free, using the hook I posted earlier.  Here it is
again, since I find it so useful.

(add-hook 'gnus-summary-prepare-hook
 (defun sj/gnus-score-select-score-file ()
   "Set score file for group based upon gnus-score-file-single-match-alist.
The first score file in the first matching entry is used."
   (let ((score-file
	  (some #'(lambda (r)
		    (if (string-match (car r) gnus-newsgroup-name)
			(cadr r)))
		gnus-score-file-single-match-alist)))
     (if (stringp score-file)
	 (gnus-score-change-score-file score-file)))))

Using this in conjunction with maintaining per-group score file
selection in gnus-score-file-single-match-alist keeps things simple
and intuitive, IMO.

-Sudish


  parent reply	other threads:[~1996-08-12  4:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-10 23:09 robert
1996-08-11  0:33 ` Lars Magne Ingebrigtsen
1996-08-11 15:53   ` robert
1996-08-11 22:16     ` Jack Vinson
1996-08-12  0:20       ` robert
1996-08-12  4:17       ` Sudish Joseph [this message]
1996-08-13  8:20         ` Lars Magne Ingebrigtsen
1996-08-14  1:02           ` score files... [patch] Sudish Joseph
1996-08-11  1:41 ` score files Sudish Joseph

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=m2ivapz15d.fsf@atreides.erehwon.org \
    --to=sudish@mindspring.com \
    /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).