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

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

Re: howto define dynamic color with gnus-summary-line-format


From: Bastien
Subject: Re: howto define dynamic color with gnus-summary-line-format
Date: Mon, 25 Feb 2008 07:39:22 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

haomiao <miaohaoz@ustc.edu> writes:

> On Feb 20, 3:16 pm, Bastien <b...@altern.org> wrote:
>> Try this instead:
>>
>> (defun gnus-user-format-function-z (header)
>>   "Test dynamic color"
>>   (let ((date-time (safe-date-to-time (mail-header-date header))))
>>     (if (string= date-time (format-time-string "%m%d"))
>>         (propertize date-time 'face my-red-face)
>>       (propertize date-time 'face my-blue-face))))
>>
>> And define `my-red-face' and `my-blue-face'.
>
> Still not worked, my code is
>
> --------------
> (copy-face 'default 'my-red-face)
> (set-face-foreground 'my-red-face "red")
> (copy-face 'default 'my-blue-face)
> (set-face-foreground 'my-blue-face "blue")
>
> (defun gnus-user-format-function-a (header)
>    "Test dynamic color"
>    (let  ((date-time (format-time-string "%m/%d" (safe-date-to-time
> (mail-header-date header)))))
>       (if (string= date-time (format-time-string "%m/%d"))
>          (propertize date-time 'face 'my-red-face 'mouse-face 'my-blue-
> face)
>          (propertize date-time 'face 'my-blue-face 'mouse-face 'my-red-
> face))))
>
> (setq gnus-summary-line-format "%U%R%z %ua: %1{%B%-23,23n%} %s\n")
> -------------
>
> It seems that gnus will modify the face property of the text
> returned,  but not the mouse-face property.

I tested and you're right, the 'mouse-face property is okay, but not the
'face property.  There is something weird in there.

Does someone can investigate this problem?

-- 
Bastien




reply via email to

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