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: Wed, 20 Feb 2008 07:16:59 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

haomiao <miaohaoz@ustc.edu> writes:

> (defun gnus-user-format-function-z (header)
>    "test dynamic color"
>    (if  (string=
>            (format-time-string "%m%d")
>            (format-time-string
>               "%m%d"
>               (safe-date-to-time (mail-header-date header))))
>       ;; then
>       (set-face-foreground 'face-3 "red")
>       ;; else
>       (set-face-foreground 'face-3 "blue"))
>    "")

Don't use `set-face-foreground'. 

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

-- 
Bastien




reply via email to

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