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

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

Re: Change the color of article counts when equal to 0


From: Sébastien Vauban
Subject: Re: Change the color of article counts when equal to 0
Date: Wed, 08 Dec 2010 15:46:25 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)

Hi Richard,

Richard Riley wrote:
> Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
>> I'm using 4 count numbers on every group line.
>>
>> I would like to see the numbers in very light gray when they're equal to 0,
>> but can't figure out how -- or, even, if possible at all... Can you help me?
>
> You need to use a user format function.
>
> The important bits for you are the propertize cells setting a special
> face for something : in your case the count value.
>
> Here is my user function y which does this for count :-
>
> ,----
> |   (defun gnus-user-format-function-y (headers)
> |     "return string representation for unread articles"
> |     (concat
> |      (propertize  (if (= (string-to-number  gnus-tmp-number-of-unread) 0) 
> "" "\x2709") 'face (rgr/unread-face "my-inbox-icon-face") 'gnus-face t)
> |      (propertize  (if (= (string-to-number  gnus-tmp-number-of-unread) 0) ""
> |                     (concat "   (" gnus-tmp-number-of-unread ")")) 'face 
> (rgr/unread-face "my-unread-count-face") 'gnus-face t)))
> `----

This helped me a lot. I could remove the count of unread messages when it's
equal to 0, with the following:

--8<---------------cut here---------------start------------->8---
      (defun gnus-user-format-function-y (headers)
        "return string representation for unread articles"
         (propertize (if (= (string-to-number gnus-tmp-number-of-unread) 0)
                         "        "
                       (concat gnus-tmp-number-of-unread " Unread"))
                     'face 'my/unread-face))

      ;; format of the group buffer
      (setq gnus-group-line-format (concat "%7{%M%}"
                                           "%8{%m%}"
                                           "%P "
                                           "%(%-39,39g%) "
                                           "%6{%3U Unseen%} + "
                                           "%5{%10uy%} "
                                           "%7{%3T Ticked%} < "
                                           "%6t Total Items"
                                           "\n"))
--8<---------------cut here---------------end--------------->8---

Though, I would like to do the same with the counts of unseen or ticked
messages, but the variable `gnus-tmp-number-of-unread' does not exist. Any
idea on how to do such?

Thanks a lot for the help you provided me with!

Best regards,
  Seb

-- 
Sébastien Vauban


reply via email to

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