[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change the color of article counts when equal to 0
From: |
Richard Riley |
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.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) |
Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
> 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
Did you mean -ticked or something else rather than -unread?
As a note I wouldnt put that fixed length empty string in - rather try
and use padding formatting in the format string if its possible.
> idea on how to do such?
It's a cross fingers and hope for the best when hacking gnus ;) I only
found that var by googling and staring at other similar examples. There
often seems no rhyme nor reason to what is available but there
invairably is ;) I asked a couple of times about how to determine what
is available but didn't get much success. Digging in the code is the
best advice I can give.
best of luck!