From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79454 Path: news.gmane.org!not-for-mail From: pmlists@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=) Newsgroups: gmane.emacs.gnus.general Subject: Re: setting face in gnus-user-format-function-x Date: Wed, 13 Jul 2011 09:36:18 +0200 Organization: Micropit Message-ID: <87oc0y3a4t.fsf@micropit.couberia.bzh> References: <87sjs5thro.fsf@micropit.couberia.bzh> <87hb8b8i2u.fsf@micropit.couberia.bzh> <87hb7hdjdj.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310542629 27801 80.91.229.12 (13 Jul 2011 07:37:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 07:37:09 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M27750@lists.math.uh.edu Wed Jul 13 09:37:06 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 1Qgu0H-0000JP-1p for ding-account@gmane.org; Wed, 13 Jul 2011 09:37:05 +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 1Qgu02-0005wl-Ro; Wed, 13 Jul 2011 02:36:50 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Qgu01-0005wU-07 for ding@lists.math.uh.edu; Wed, 13 Jul 2011 02:36:49 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Qgtzz-0003Xn-JZ for ding@lists.math.uh.edu; Wed, 13 Jul 2011 02:36:48 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Qgtzw-0004CF-Og for ding@gnus.org; Wed, 13 Jul 2011 09:36:44 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qgtzw-0000BX-J6 for ding@gnus.org; Wed, 13 Jul 2011 09:36:44 +0200 Original-Received: from arennes-651-1-106-120.w2-2.abo.wanadoo.fr ([2.2.1.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Jul 2011 09:36:44 +0200 Original-Received: from pmlists by arennes-651-1-106-120.w2-2.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Jul 2011 09:36:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: arennes-651-1-106-120.w2-2.abo.wanadoo.fr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:fhzAllPKxzx/Aqo4ENY50d8b4SQ= X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79454 Archived-At: On Mon, Jul 11 2011, Michael Piotrowski wrote: > I found I needed to set `inhibit-read-only' to t; in any case, here are > my functions in full: > > [...] > > Hope this helps Yes and no: the face is set, but not updated. Could you please try this, and tell me, if it works for you: --8<---------------cut here---------------start------------->8--- (setq gnus-summary-line-format "%ux%R%3P %-10&user-date; %-17,17f(%4k)%* %B%s\n") (defun gnus-user-format-function-x (header) (let* ((mark gnus-tmp-unread) (str (format "%c" mark))) (cond ((equal mark gnus-ancient-mark) (put-text-property 0 1 'my-prop 'read str)) (t (put-text-property 0 1 'my-prop 'unread str))) str)) (defun my-gnus-fontify-summary-line () (save-excursion (let* ((inhibit-read-only t) (my-region (gnus-find-text-property-region (point-at-bol) (point-at-eol) 'my-prop)) (start (caar my-region)) (end (cadar my-region))) (cond ((eq (caddar my-region) 'unread) (gnus-put-text-property start end 'face gnus-face-2)) (t (gnus-put-text-property start end 'face gnus-face-3)))))) (add-hook 'gnus-summary-update-hook 'my-gnus-fontify-summary-line) --8<---------------cut here---------------end--------------->8--- Nevertheless, thanks for you efforts! -- Peter