Gnus development mailing list
 help / color / mirror / Atom feed
* The old high low face gambit
@ 2001-12-07 20:23 Harry Putnam
  2001-12-09  0:00 ` Bill White
  0 siblings, 1 reply; 4+ messages in thread
From: Harry Putnam @ 2001-12-07 20:23 UTC (permalink / raw)


How can I get finer granularity than just `high' face and `low' face
on the basis of scoring?

I mean something like a face for scores of 1, different for 5, different
yet above 10 etc.  (I have the default score set to 1)

I'm thinking about using procmail to add something to incoming
messages of choice that gnus can score on.  Maybe an assortment like:

   X-Score-Line: NUMBER
Where formail/procmail sets NUMBER according to my recipe.

And set up scoring to read the NUMBER and color the summary buffer
accordingly.  I don't really know how to do that part either but
pretty sure it can be done.  Even if by adding X-Score-Line to xtra
headers. 

But I don't see a handy way to invoke any other faces than low and
high. 



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

* Re: The old high low face gambit
  2001-12-07 20:23 The old high low face gambit Harry Putnam
@ 2001-12-09  0:00 ` Bill White
  2001-12-09  8:48   ` Harry Putnam
  0 siblings, 1 reply; 4+ messages in thread
From: Bill White @ 2001-12-09  0:00 UTC (permalink / raw)
  Cc: ding

On the Memorial of Saint Ambrose, 2001, at 14:23, Harry Putnam <reader@newsguy.com> said:

> How can I get finer granularity than just `high' face and `low' face
> on the basis of scoring?
>
> I mean something like a face for scores of 1, different for 5,
> different yet above 10 etc.  (I have the default score set to 1)

I tried this for a while but couldn't get a meaningful *and* pleasing
*and* easy-to-read combination of colors.  After a while it just
bugged me and I wound up ditching scoring altogether.  At any rate,
here's the code I used:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; trying different faces for different scores

(copy-face 'default 'my-gnus-face-50)
(set-face-foreground 'my-gnus-face-50 "gray50")

(copy-face 'default 'my-gnus-face-55)
(set-face-foreground 'my-gnus-face-55 "gray55")

(copy-face 'default 'my-gnus-face-60)
(set-face-foreground 'my-gnus-face-60 "gray60")

(copy-face 'default 'my-gnus-face-65)
(set-face-foreground 'my-gnus-face-65 "gray65")

(copy-face 'default 'my-gnus-face-70)
(set-face-foreground 'my-gnus-face-70 "gray70")

(copy-face 'default 'my-gnus-face-75)
(set-face-foreground 'my-gnus-face-75 "gray75")

(copy-face 'default 'my-gnus-face-80)
(set-face-foreground 'my-gnus-face-80 "gray80")

(copy-face 'default 'my-gnus-face-85)
(set-face-foreground 'my-gnus-face-85 "gray85")

(copy-face 'default 'my-gnus-face-90)
(set-face-foreground 'my-gnus-face-90 "gray90")

(copy-face 'default 'my-gnus-face-95)
(set-face-foreground 'my-gnus-face-95 "gray95")

(copy-face 'default 'my-gnus-face-100)
(set-face-foreground 'my-gnus-face-100 "gray100")

(setq gnus-summary-highlight
  '(
    ((and (<= score 100) (> score 0)) . my-gnus-face-80)
    ((and (<= score 200) (> score 100)) . my-gnus-face-85)
    ((and (<= score 300) (> score 200)) . my-gnus-face-90)
    ((and (<= score 400) (> score 300)) . my-gnus-face-95)
    ((> score 400) . my-gnus-face-100)
    ((= mark gnus-canceled-mark)
     . gnus-summary-cancelled-face)
    ((and (> score default)
	  (or (= mark gnus-dormant-mark)
	      (= mark gnus-ticked-mark)))
     . gnus-summary-high-ticked-face)
    ((and (< score default)
	  (or (= mark gnus-dormant-mark)
	      (= mark gnus-ticked-mark)))
     . gnus-summary-low-ticked-face)
    ((or (= mark gnus-dormant-mark)
	 (= mark gnus-ticked-mark))
     . gnus-summary-normal-ticked-face)
    ((and (> score default) (= mark gnus-ancient-mark))
     . gnus-summary-high-ancient-face)
    ((and (< score default) (= mark gnus-ancient-mark))
     . gnus-summary-low-ancient-face)
    ((= mark gnus-ancient-mark)
     . gnus-summary-normal-ancient-face)
    ((and (> score default) (= mark gnus-unread-mark))
     . gnus-summary-high-unread-face)
    ((and (< score default) (= mark gnus-unread-mark))
     . gnus-summary-low-unread-face)
    ((= mark gnus-unread-mark)
     . gnus-summary-normal-unread-face)
    ((and (> score default) (memq mark (list gnus-downloadable-mark
					     gnus-undownloaded-mark)))
     . gnus-summary-high-unread-face)
    ((and (< score default) (memq mark (list gnus-downloadable-mark
					     gnus-undownloaded-mark)))
     . gnus-summary-low-unread-face)
    ((and (memq mark (list gnus-downloadable-mark gnus-undownloaded-mark))
	  (memq article gnus-newsgroup-unreads))
     . gnus-summary-normal-unread-face)
    ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark))
     . gnus-summary-normal-read-face)
    ((> score default)
     . gnus-summary-high-read-face)
    ((< score default)
     . gnus-summary-low-read-face)
    (t
     . gnus-summary-normal-read-face)))


Cheers -

bw
-- 
Bill White . billw@wolfram.com . http://members.wri.com/billw
"No ma'am, we're musicians."



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

* Re: The old high low face gambit
  2001-12-09  0:00 ` Bill White
@ 2001-12-09  8:48   ` Harry Putnam
  2001-12-09 22:45     ` Bill White
  0 siblings, 1 reply; 4+ messages in thread
From: Harry Putnam @ 2001-12-09  8:48 UTC (permalink / raw)


[NOTE: repost of something I butchered in some awful way due to heavy
local tinkerage.  Somehow ended up on ding with no subject]

Bill White <billw@wolfram.com> writes:

> On the Memorial of Saint Ambrose, 2001, at 14:23, Harry Putnam <reader@newsguy.com> said:
>
>> How can I get finer granularity than just `high' face and `low' face
>> on the basis of scoring?
>>
>> I mean something like a face for scores of 1, different for 5,
>> different yet above 10 etc.  (I have the default score set to 1)
>
> I tried this for a while but couldn't get a meaningful *and* pleasing
> *and* easy-to-read combination of colors.  After a while it just
> bugged me and I wound up ditching scoring altogether.  At any rate,
> here's the code I used:

Thanks bill, looks like what I was after.

[...]
Probably just my lack of lisp knowledgw but what about faces 50 thru
75?

Where do they come in?

And what, in general does the rest of it do?

> (setq gnus-summary-highlight
>   '(
>     ((and (<= score 100) (> score 0)) . my-gnus-face-80)
>     ((and (<= score 200) (> score 100)) . my-gnus-face-85)
>     ((and (<= score 300) (> score 200)) . my-gnus-face-90)
>     ((and (<= score 400) (> score 300)) . my-gnus-face-95)
>     ((> score 400) . my-gnus-face-100)
>     ((= mark gnus-canceled-mark)

I guess a blow by blow thing  is out of the question but it looks like
some kind of trick stuff is happening with lots of existing variables
like ancient face, default face etc.   Can I just ignore all that? I'm
thinking along the line of maybe 3-4 special scoring faces.

I'm thinking like adding a line with procmail, since I use procmail
anyway, to certain messages like:
X-Score: 5 

I'm thinking procmail because the reason for adding a scoring line may
change frequently and procmail lends itself to being chaned quickly
from the command line.  I can imaging scripting that would quickly
insert a rule to add X-Score: 10 to replies to a certain message for
example.

Then having scoring set up to find the 10 or whatever and set a face.
Similar for other higher/lower faces.

It would be one way to have followup scoring without invoking the
dreaded `adaptive' score files.



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

* Re: The old high low face gambit
  2001-12-09  8:48   ` Harry Putnam
@ 2001-12-09 22:45     ` Bill White
  0 siblings, 0 replies; 4+ messages in thread
From: Bill White @ 2001-12-09 22:45 UTC (permalink / raw)
  Cc: ding

On the Second Sunday of Advent, 2001, at 02:48, Harry Putnam <reader@newsguy.com> said:

>> On the Memorial of Saint Ambrose, 2001, at 14:23, Harry Putnam <reader@newsguy.com> said:
>>
>>> How can I get finer granularity than just `high' face and `low'
>>> face on the basis of scoring?

[...]

>> I tried this for a while but couldn't get a meaningful *and*
>> pleasing *and* easy-to-read combination of colors.  After a while
>> it just bugged me and I wound up ditching scoring altogether.  At
>> any rate, here's the code I used:
>
> Thanks bill, looks like what I was after.
>
> [...]
> Probably just my lack of lisp knowledgw but what about faces 50 thru
> 75?

I posted the last iteration of my code.  I had tried those other faces
in the grand coloring scheme, but they had no meaning when they
appeared by themselves with no slightly lighter or darker faces to
compare them to, so fewer faces worked better in my setup.

> Where do they come in?

I probably used to do something with a higher resolution like this:

((and (<= score 120) (> score 100)) . my-gnus-face-60)
((and (<= score 140) (> score 120)) . my-gnus-face-65)
((and (<= score 160) (> score 140)) . my-gnus-face-70)

etc.

> And what, in general does the rest of it do?

The lines at the top that deal with scoring are just my additions to
the default value of gnus-summary-highlight.  Since then, Daniel
Pittman showed me a better way to add conditions to g-s-h, and what is
probably a better way to define faces.

>> (setq gnus-summary-highlight
>>   '(
>>     ((and (<= score 100) (> score 0)) . my-gnus-face-80)
>>     ((and (<= score 200) (> score 100)) . my-gnus-face-85)
>>     ((and (<= score 300) (> score 200)) . my-gnus-face-90)
>>     ((and (<= score 400) (> score 300)) . my-gnus-face-95)
>>     ((> score 400) . my-gnus-face-100)
>>     ((= mark gnus-canceled-mark)

,----[ ~/.gnus ]
| (defface gnus-summary-process-face
|   '((((class color))
|      (:foreground "deeppink" :background "black")))
|   "Face used for process-marked articles.")
| 
| (require 'gnus-sum)
| (require 'cl)
| (pushnew '((memq (gnus-summary-article-number)
|                  gnus-newsgroup-processable)
|            . gnus-summary-process-face)
|          gnus-summary-highlight)
`----

That "pushnew" thingie will add code to the beginning of g-s-h, just
like I did by hand.  See message <ruo8zemj59i.fsf@g.wolfram.com> and
<url:http://www.gnus.org/list-archives/ding/200109/msg00530.html>.

Something like this should work (untested):

,----
| (require 'gnus-sum)
| (require 'cl)
| (pushnew '((> score 400)                      . my-gnus-face-100) gnus-summary-highlight)
| (pushnew '((and (<= score 400) (> score 300)) . my-gnus-face-95)  gnus-summary-highlight)
| (pushnew '((and (<= score 300) (> score 200)) . my-gnus-face-90)  gnus-summary-highlight)
| (pushnew '((and (<= score 200) (> score 100)) . my-gnus-face-85)  gnus-summary-highlight)
| (pushnew '((and (<= score 100) (> score   0)) . my-gnus-face-80)  gnus-summary-highlight)
`----

> I guess a blow by blow thing is out of the question but it looks
> like some kind of trick stuff is happening with lots of existing
> variables like ancient face, default face etc.  Can I just ignore
> all that? I'm thinking along the line of maybe 3-4 special scoring
> faces.

Did the stuff above answer these questions?

> I'm thinking like adding a line with procmail, since I use procmail
> anyway, to certain messages like: X-Score: 5
>
> I'm thinking procmail because the reason for adding a scoring line
> may change frequently and procmail lends itself to being chaned
> quickly from the command line.  I can imaging scripting that would
> quickly insert a rule to add X-Score: 10 to replies to a certain
> message for example.
>
> Then having scoring set up to find the 10 or whatever and set a
>face.  Similar for other higher/lower faces.

That sounds like a sensible kind of scoring.

> It would be one way to have followup scoring without invoking the
> dreaded `adaptive' score files.

Amen.  I came to hate adaptive scoring.

Cheers -

bw
-- 
Bill White . billw@wolfram.com . http://members.wri.com/billw
"No ma'am, we're musicians."



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

end of thread, other threads:[~2001-12-09 22:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-07 20:23 The old high low face gambit Harry Putnam
2001-12-09  0:00 ` Bill White
2001-12-09  8:48   ` Harry Putnam
2001-12-09 22:45     ` Bill White

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