[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: howto define dynamic color with gnus-summary-line-format
From: |
haomiao |
Subject: |
Re: howto define dynamic color with gnus-summary-line-format |
Date: |
Wed, 20 Feb 2008 16:57:49 -0800 (PST) |
User-agent: |
G2/1.0 |
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.