From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/14160 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.gnus.user Subject: Re: Change the color of article counts when equal to 0 Date: Tue, 12 Oct 2010 14:05:24 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: <80iq17u1ff.fsf@mundaneum.com> <80r5fvwrw2.fsf@mundaneum.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291955993 9961 80.91.229.12 (10 Dec 2010 04:39:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 04:39:53 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Dec 10 05:39:49 2010 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQulp-0001Nj-Hz for gegu-info-gnus-english@m.gmane.org; Fri, 10 Dec 2010 05:39:49 +0100 Original-Received: from localhost ([127.0.0.1]:36735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQuhz-0001YZ-Je for gegu-info-gnus-english@m.gmane.org; Thu, 09 Dec 2010 23:35:51 -0500 Original-Path: usenet.stanford.edu!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!uio.no!quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 77 Original-NNTP-Posting-Host: 85.183.18.158 Original-X-Trace: quimby.gnus.org 1286885127 10944 85.183.18.158 (12 Oct 2010 12:05:27 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Tue, 12 Oct 2010 12:05:27 +0000 (UTC) User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-Original-Bytes: 4019 Original-Xref: usenet.stanford.edu gnu.emacs.gnus:84836 X-Mailman-Approved-At: Thu, 09 Dec 2010 20:27:54 -0500 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:14160 Archived-At: Sébastien Vauban writes: > Hi Richard, > > Richard Riley wrote: >> Sébastien Vauban 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!