From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79031 Path: news.gmane.org!not-for-mail From: Michael Piotrowski Newsgroups: gmane.emacs.gnus.general Subject: Re: setting face in gnus-user-format-function-x Date: Tue, 07 Jun 2011 18:24:35 +0200 Organization: dynalabs Network Research Unit Message-ID: References: <87sjs5thro.fsf@micropit.couberia.bzh> <87hb8b8i2u.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1307464012 19482 80.91.229.12 (7 Jun 2011 16:26:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2011 16:26:52 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M27330@lists.math.uh.edu Tue Jun 07 18:26:48 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QTz7A-0001hY-2Z for ding-account@gmane.org; Tue, 07 Jun 2011 18:26:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QTz5v-0007n0-QI; Tue, 07 Jun 2011 11:25:31 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QTz5u-0007mr-J6 for ding@lists.math.uh.edu; Tue, 07 Jun 2011 11:25:30 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1QTz5s-0002HT-3c for ding@lists.math.uh.edu; Tue, 07 Jun 2011 11:25:30 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QTz5p-0003xI-4U for ding@gnus.org; Tue, 07 Jun 2011 18:25:25 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QTz5o-000187-Md for ding@gnus.org; Tue, 07 Jun 2011 18:25:24 +0200 Original-Received: from 130.60.156.182 ([130.60.156.182]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jun 2011 18:25:24 +0200 Original-Received: from mxp by 130.60.156.182 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Jun 2011 18:25:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 130.60.156.182 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (berkeley-unix) X-Face: %OvAx]kKl`N,i?yQ+$^p9w2oy)Yg|O}a_~6wtRQ@UTZ*(jSPubbonT]m++M>YBtJqkZZa!W"y5`aI.FoKO%$JHz=ws|i?y^o2bds(+pcp>gcX]H}?-tCzL^ABzJUWYzS{"!_hFg:JD)`kxRKLsNp X-Operating-System: NetBSD Cancel-Lock: sha1:vXvFXk2w9O4GbDwBvho9RAwcqZ8= X-Spam-Score: -3.7 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79031 Archived-At: On 2011-05-31, pmlists@free.fr (Peter Münster) wrote: >>> I would like to set different faces for some marks in the summary lines. >>> But unfortunately, when changing the mark, the mark-letter is updated, >>> but the face is not. Only after reopening the group, the faces get >>> right. >> >> I think your best bet would be to put a function into >> `gnus-summary-update-hook', possibly calling >> `gnus-summary-update-article-line' to delete the line and reinsert it. > > Oh, no chance for an easier solution...? :( > Ok, one day, I'll try it. I just tried it. Using `gnus-summary-update-hook' works. For my application--a different face for the date, depending on the age of the message--I used the following two-step approach: 1. I have a user format function that adds a non-face property, roughly something like this: (cond ((= message-day today) (put-text-property 0 10 'mxp-date 'today message-date)) ((= message-day (1- today)) (put-text-property 0 10 'mxp-date 'yesterday message-date)) (t (put-text-property 0 10 'mxp-date 'older message-date))) 2. I have a function that looks for this property (using `gnus-find-text-property-region') and sets the desired face. This function is called by `gnus-summary-update-hook'. Up to now, this approach seems to work nicely. Maybe you can adapt it to your needs. Greetings -- Dr.-Ing. Michael Piotrowski, M.A. Public key at (ID 0x1614A044)