info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting summary buffer color by header/body content


From: marklar
Subject: Re: setting summary buffer color by header/body content
Date: Sun, 27 Apr 2008 23:21:22 -0700 (PDT)
User-agent: G2/1.0

On Apr 25, 2:43 pm, marklar <markpr...@gmail.com> wrote:
> Mutt and pine have facilities for setting the color of the summary
> line for each message in the inbox according to text contained in the
> header or the body of the message.

<snip/>

> Is there code written for gnus that does the same thing?  I.e. maybe
> something from someone's .gnus file?
>

I have made some progress in this and will share what I have found so
far.
The solution appears to involve the gnus-summary-highlight variable,
which wants to contain a list:
(setq gnus-summary-highlight (list
        '((condition) . face)
        '((condition) . face)))
For the first item in the list where condition evaluates to true, face
is applied to that line of the summary buffer.
Just trying to get off the ground, I did the following:
;; define a face, which is horrible to look at but gives quick
recognition of success if used
(make-face 'gnus-redfg-bluebg)
(set-face-foreground 'gnus-redfg-bluebg "red1")
(set-face-background 'gnus-redfg-bluebg "blue1")
;; use face gnus-redfg-bluebg if 1==1
(setq gnus-summary-highlight
      (list
         '((eq 1 1) . gnus-redfg-bluebg)))

This results in every line of the summary having red foreground and
blue background.  Ugly but noticeable.
The next step, now, is to get the conditions to match based on a non-
trivial condition.
The critical step here seems to be to be figuring out how to examine
the message.  All of the example code I could find was using the
scoring system.  What I am hoping for is to determine the face by
examining the contents of the header and/or body.  Is there a reason
why not to do this?

From here, the question seems to be "how do I look at the header/
body?"

Marklar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]