From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79495 Path: news.gmane.org!not-for-mail From: pmlists@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=) Newsgroups: gmane.emacs.gnus.general Subject: special face for marks (was: setting face in gnus-user-format-function-x) Date: Mon, 18 Jul 2011 23:09:20 +0200 Organization: Micropit Message-ID: <87sjq3xpmn.fsf@micropit.couberia.bzh> References: <87sjs5thro.fsf@micropit.couberia.bzh> 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 1311023442 24755 80.91.229.12 (18 Jul 2011 21:10:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 21:10:42 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M27791@lists.math.uh.edu Mon Jul 18 23:10:38 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 1Qiv5J-0003rx-NA for ding-account@gmane.org; Mon, 18 Jul 2011 23:10:38 +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 1Qiv4P-0002lU-4r; Mon, 18 Jul 2011 16:09:41 -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 1Qiv4M-0002lG-C5 for ding@lists.math.uh.edu; Mon, 18 Jul 2011 16:09:38 -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 1Qiv4J-0002vG-Sx for ding@lists.math.uh.edu; Mon, 18 Jul 2011 16:09:37 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Qiv4H-0001pH-S5 for ding@gnus.org; Mon, 18 Jul 2011 23:09:33 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qiv4H-0003UO-7j for ding@gnus.org; Mon, 18 Jul 2011 23:09:33 +0200 Original-Received: from arennes-651-1-220-25.w90-32.abo.wanadoo.fr ([90.32.95.25]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2011 23:09:33 +0200 Original-Received: from pmlists by arennes-651-1-220-25.w90-32.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2011 23:09:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 67 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: arennes-651-1-220-25.w90-32.abo.wanadoo.fr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:MtQ+Xy9Qm4gD3EgHxy9PujvclgI= X-Spam-Score: -6.0 (------) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79495 Archived-At: On Mon, May 30 2011, Lars Magne Ingebrigtsen wrote: > pmlists@free.fr (Peter Münster) writes: > >> 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. Unfortunately, there were too many side effects, when calling gnus-summary-update-article-line: - %P (line number) broken - %B (thread symbols) vanished - strange behaviour when dummy-lines are present - perhaps more... But today I've found a solution, that works quite well. Perhaps you could add something like that to Gnus. My motivation: various faces for different states are nice, but when the faces are set for the whole lines, it can disturb the eyes. Setting the face just for the mark can look better. Pine/Alpine does it like that, and I liked it. So, here the solution, that works for me: --8<---------------cut here---------------start------------->8--- (setq gnus-summary-highlight-mark '(gnus-ticked-mark gnus-ticked-mark-face gnus-unseen-mark gnus-new-mark-face gnus-unread-mark gnus-new-mark-face gnus-read-mark gnus-read-mark-face gnus-killed-mark gnus-del-mark-face gnus-expirable-mark gnus-del-mark-face gnus-replied-mark gnus-replied-mark-face gnus-forwarded-mark gnus-replied-mark-face gnus-recent-mark gnus-new-mark-face gnus-ancient-mark gnus-read-mark-face gnus-dormant-mark gnus-ticked-mark-face)) (defun my-mark-face (chr) (let ((face 'gnus-unknown-mark-face) (list gnus-summary-highlight-mark)) (while list (if (equal (symbol-value (car list)) chr) (setq face (cadr list) list nil) (setq list (cddr list)))) face)) (defun my-summary-update () (save-excursion (beginning-of-line) ; because here is the mark! (let* ((inhibit-read-only t) (pt (point)) (chr (char-after pt))) (put-text-property pt (1+ pt) 'face (my-mark-face chr))))) (add-hook 'gnus-summary-update-hook 'my-summary-update) --8<---------------cut here---------------end--------------->8--- -- Peter