Gnus development mailing list
 help / color / mirror / Atom feed
* score files...
@ 1996-08-10 23:09 robert
  1996-08-11  0:33 ` Lars Magne Ingebrigtsen
  1996-08-11  1:41 ` score files Sudish Joseph
  0 siblings, 2 replies; 9+ messages in thread
From: robert @ 1996-08-10 23:09 UTC (permalink / raw)


OK how do I trap an entire heirarchy?

ie. I want to score comp.lang.java.everything but also comp.lang.java

Do I need two score files?

Currently I've got.

comp.lang.java.all.SCORE
nntp+news:comp.lang.java.all.SCORE

(gnus-score-find-bnews "nntp+news:comp.lang.java")
("/export/home/robert/News/all.SCORE" 
"/export/home/robert/News/nntp+news:comp.lang.java.SCORE")

(gnus-score-find-bnews "nntp+news:comp.lang.java.misc")
("/export/home/robert/News/nntp+news:comp.lang.java.all.SCORE"
"/export/home/robert/News/comp.lang.java.all.SCORE"
"/export/home/robert/News/all.SCORE"
"/export/home/robert/News/nntp+news:comp.lang.java.misc.SCORE")

(gnus-score-find-bnews "comp.lang.java")
("/export/home/robert/News/all.SCORE"
"/export/home/robert/News/comp.lang.java.SCORE")

(gnus-score-find-bnews "comp.lang.java.misc")
("/export/home/robert/News/comp.lang.java.all.SCORE"
"/export/home/robert/News/all.SCORE"
"/export/home/robert/News/comp.lang.java.misc.SCORE")


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  1996-08-10 23:09 score files robert
@ 1996-08-11  0:33 ` Lars Magne Ingebrigtsen
  1996-08-11 15:53   ` robert
  1996-08-11  1:41 ` score files Sudish Joseph
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-08-11  0:33 UTC (permalink / raw)



<robert@elastica.com> writes:

> OK how do I trap an entire heirarchy?
> 
> ie. I want to score comp.lang.java.everything but also comp.lang.java

If think if you call the score file "comp.lang.java.*.SCORE" (yes,
with a "*" in there), it should apply to the entire hierarchy.
Alternatively, you could use "comp.lang.java.all.SCORE" and then put a
`score-file' group parameter in comp.lang.java that points to that
file. 

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  1996-08-10 23:09 score files robert
  1996-08-11  0:33 ` Lars Magne Ingebrigtsen
@ 1996-08-11  1:41 ` Sudish Joseph
  1 sibling, 0 replies; 9+ messages in thread
From: Sudish Joseph @ 1996-08-11  1:41 UTC (permalink / raw)


In article <199608102309.TAA02898@justine.elastica.com>,
<robert@elastica.com> writes:
> OK how do I trap an entire heirarchy?
> ie. I want to score comp.lang.java.everything but also comp.lang.java

I use gnus-score-file-single-match-alist for this purpose since I find
it easier than spreading the information over lots of group params.

For eg.,
(setq gnus-score-file-single-match-alist
      '(("emacs" "Emacs.SCORE")
        ("java" "Java.SCORE")))

This would add Java.SCORE to the list of score files used for any
group containing java in it's name.  I capitalize the names of files I
put in there to avoid clashes with ding.

Now, all you need to do is to remember to add entries to Java.SCORE
when in a java group.  To select a score file from the -s-m-alist, I
use: 

(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)))))

This is very useful, as you never need to use "V c" when entering such
groups, but still get to see all entries for *.emacs.*, say, in one
file.

-Sudish


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  1996-08-11  0:33 ` Lars Magne Ingebrigtsen
@ 1996-08-11 15:53   ` robert
  1996-08-11 22:16     ` Jack Vinson
  0 siblings, 1 reply; 9+ messages in thread
From: robert @ 1996-08-11 15:53 UTC (permalink / raw)
  Cc: ding

Actually on further review it looks like comp.lang.java.SCORE matches the
entire hierarchy.

robert:/export/home/robert/News>ls -al *java*.SCORE                       11:49
-rw-r--r--   1 robert   staff        136 Aug 10 21:44 comp.lang.java.SCORE
lrwxrwxrwx   1 robert   staff         20 Aug 10 19:22 nntp+news:comp.lang.java.SCORE -> comp.lang.java.SCORE

(gnus-score-find-bnews "comp.lang.java")
("/export/home/robert/News/comp.lang.java.ADAPT" "/export/home/robert/News/all.SCORE" "/export/home/robert/News/comp.lang.java.SCORE")

(gnus-score-find-bnews "comp.lang.java.something")
("/export/home/robert/News/comp.lang.java.SCORE" "/export/home/robert/News/comp.lang.java.ADAPT" "/export/home/robert/News/all.SCORE" "/export/home/robert/News/comp.lang.java.something.SCORE")

(gnus-score-find-bnews "comp.lang.java.something.something")
("/export/home/robert/News/comp.lang.java.SCORE" "/export/home/robert/News/comp.lang.java.ADAPT" "/export/home/robert/News/all.SCORE" "/export/home/robert/News/comp.lang.java.something.something.SCORE")







-- 
You are amazed that they exist and they burn so 
bright whilst you can only wonder why.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  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
  0 siblings, 2 replies; 9+ messages in thread
From: Jack Vinson @ 1996-08-11 22:16 UTC (permalink / raw)


>>>>>   <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.

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?


-- 
Jack Vinson                   The Purple Puddle Eater and Captain Jack
jvinson@cheux.ecs.umass.edu   <http://www.cis.upenn.edu/~vinson/home.html>
Sunderland, MA
"Skin ain't got no tailored pockets."	- Eat _Sell_Me_a_God_


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  1996-08-11 22:16     ` Jack Vinson
@ 1996-08-12  0:20       ` robert
  1996-08-12  4:17       ` Sudish Joseph
  1 sibling, 0 replies; 9+ messages in thread
From: robert @ 1996-08-12  0:20 UTC (permalink / raw)
  Cc: ding

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.

I think you'll find that isn't the case... I'm not sure if you're saying I'm
wrong or suggesting how it _should_ work..

Anyway, 

robert:/export/home/robert/News>ls -al *.SCORE                            20:17
-rw-r--r--   1 robert   other         46 Aug  3 18:19 all.SCORE
-rw-r--r--   1 robert   staff        136 Aug 10 21:44 comp.lang.java.SCORE
-rw-r--r--   1 robert   staff          0 Aug 11 20:17 comp.lang.java.all.SCORE
-rw-r--r--   1 robert   staff        223 Aug 11 12:47 comp.lang.perl.SCORE
-rw-r--r--   1 robert   staff         87 Jun 12 21:20 nnfolder:jobs.SCORE
lrwxrwxrwx   1 robert   staff         20 Aug 10 19:22 nntp+news:comp.lang.java.SCORE -> comp.lang.java.SCORE
lrwxrwxrwx   1 robert   staff         20 Aug 11 12:48 nntp+news:comp.lang.perl.SCORE -> comp.lang.perl.SCORE

(gnus-score-find-bnews "comp.lang.java")
("/export/home/robert/News/comp.lang.java.ADAPT" "/export/home/robert/News/all.SCORE" "/export/home/robert/News/comp.lang.java.SCORE")

(gnus-score-find-bnews "comp.lang.java.misc")
("/export/home/robert/News/comp.lang.java.misc.ADAPT" "/export/home/robert/News/comp.lang.java.all.SCORE" "/export/home/robert/News/comp.lang.java.SCORE" "/export/home/robert/News/comp.lang.java.ADAPT" "/export/home/robert/News/all.SCORE" "/export/home/robert/News/comp.lang.java.misc.SCORE")










> 
> 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?
> 
> 
> -- 
> Jack Vinson                   The Purple Puddle Eater and Captain Jack
> jvinson@cheux.ecs.umass.edu   <http://www.cis.upenn.edu/~vinson/home.html>
> Sunderland, MA
> "Skin ain't got no tailored pockets."	- Eat _Sell_Me_a_God_
> 

-- 
You are amazed that they exist and they burn so 
bright whilst you can only wonder why.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  1996-08-11 22:16     ` Jack Vinson
  1996-08-12  0:20       ` robert
@ 1996-08-12  4:17       ` Sudish Joseph
  1996-08-13  8:20         ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 9+ messages in thread
From: Sudish Joseph @ 1996-08-12  4:17 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files...
  1996-08-12  4:17       ` Sudish Joseph
@ 1996-08-13  8:20         ` Lars Magne Ingebrigtsen
  1996-08-14  1:02           ` score files... [patch] Sudish Joseph
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-08-13  8:20 UTC (permalink / raw)



Sudish Joseph <sudish@mindspring.com> writes:

> >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?

I think this is still the case.

> 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 now possible with the `gnus-home-score-file' alist. 

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: score files... [patch]
  1996-08-13  8:20         ` Lars Magne Ingebrigtsen
@ 1996-08-14  1:02           ` Sudish Joseph
  0 siblings, 0 replies; 9+ messages in thread
From: Sudish Joseph @ 1996-08-14  1:02 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
> This is now possible with the `gnus-home-score-file' alist. 

Cool!  It's somewhat ironic that ding provided so many hooks that were
needed in earlier versions--and removes the need for those hooks.

Since this is a new feature, can we make a small change?  The patch is
self-explanatory.  I hope no one is using this as yet/won't mind it
terribly.

(setq gnus-home-score-file gnus-score-file-single-match-alist) is
easier than maintaining two separate alists, for those that use both.

-Sudish


--- gnus-score.el~	Tue Aug 13 20:50:57 1996
+++ gnus-score.el	Tue Aug 13 20:50:57 1996
@@ -136,9 +136,11 @@
  * A list
    The elements in this list can be:
 
-   * `(regexp . file-name)'
-     If the `regexp' matches the group name, the `file-name' will
-     will be used as the home score file.
+   * `(regexp file-name ...)'
+     If the `regexp' matches the group name, the first `file-name' will
+     will be used as the home score file.  (Multiple filenames are
+     allowed so that one may use gnus-score-file-single-match-alist to
+     set this variable.)
 
    * A function.
      If the function returns non-nil, the result will be used
@@ -2495,7 +2497,7 @@
 	     ;; Regexp-file cons
 	     ((consp elem)
 	      (when (string-match (car elem) group)
-		(cdr elem))))))
+		(cadr elem))))))
     (when found
       (nnheader-concat gnus-kill-files-directory found))))
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1996-08-14  1:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-10 23:09 score files 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
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

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).