Gnus development mailing list
 help / color / mirror / Atom feed
* Face bug in Gnus manual (Re: fontifacation not working everywhere)
       [not found]   ` <86vfgvcjad.fsf@logolalia.com>
@ 2005-02-04 12:23     ` Károly Lőrentey
  0 siblings, 0 replies; only message in thread
From: Károly Lőrentey @ 2005-02-04 12:23 UTC (permalink / raw)



[-- Attachment #1.1.1.1: Type: text/plain, Size: 2759 bytes --]

Seven months ago, Dan Waber <dwaber@logolalia.com> wrote:
> Any gnus session that is created from a terminal emacs or emacsclient,
> regardless of whether the emacs was started in a terminal or a gui
> frame, fails to properly fontify the *Group* buffer, and I get things
> in the *Messages* buffer like:
>
> Invalid face reference: my-group-face-4 [7 times]
[etc]
>
> This is in my .gnus, straight out of Info:
>
> (cond (window-system
>             (setq custom-background-mode 'light)
>             (defface my-group-face-1
>      	 '((t (:foreground "Red" :bold t))) "First group face")
>             (defface my-group-face-2
>      	 '((t (:foreground "DarkSeaGreen4" :bold t))) "Second group face")
>             (defface my-group-face-3
>      	 '((t (:foreground "Green4" :bold t))) "Third group face")
>             (defface my-group-face-4
>      	 '((t (:foreground "SteelBlue" :bold t))) "Fourth group face")
>             (defface my-group-face-5
>      	 '((t (:foreground "Blue" :bold t))) "Fifth group face")))
>      
> (setq gnus-group-highlight
>            '(((> unread 200) . my-group-face-1)
>              ((and (< level 3) (zerop unread)) . my-group-face-2)
>              ((< level 3) . my-group-face-3)
>              ((zerop unread) . my-group-face-4)
>              (t . my-group-face-5)))

The above example in the Gnus manual (See <info:(gnus)Group Highlighting>) 
seems somewhat suboptimal to me in that it only works on a graphical
display.  In the assignment to gnus-group-highlight, it
unconditionally refers to conditionally defined faces.  Statically
branching on the value of window-system is not future-proof anyway; it
is better to simply remove the condition, or perhaps replace it with
guard conditions inside defface.  (The window-system variable is
frame-local on multi-tty-capable Emacsen.)

(defface my-group-face-1
  '((((class color)) (:foreground "Red" :bold t))) "First group face")
(defface my-group-face-2
  '((((class color)) (:foreground "DarkSeaGreen4" :bold t))) "Second group face")
(defface my-group-face-3
  '((((class color)) (:foreground "Green4" :bold t))) "Third group face")
(defface my-group-face-4
  '((((class color)) (:foreground "SteelBlue" :bold t))) "Fourth group face")
(defface my-group-face-5
  '((((class color)) (:foreground "Blue" :bold t))) "Fifth group face")

In addition, I don't have a `custom-background-mode' variable, but
only `frame-background-mode'.  It doesn't seem clear to me what the
setq to it in the above code is supposed to achieve, anyway, in light
of the description before it explicitly referring to a dark background.

(P.S. The strange cond with the single clause also looks silly.) :-)

-- 
Károly

[-- Attachment #1.1.1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 145 bytes --]

_______________________________________________
multi-tty mailing list
multi-tty@lists.fnord.hu
http://lists.fnord.hu/mailman/listinfo/multi-tty

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-04 12:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <861xjueykd.fsf@logolalia.com>
     [not found] ` <lorentey.l.multi-tty.87smbz35ts.elte@eris.elte.hu>
     [not found]   ` <86vfgvcjad.fsf@logolalia.com>
2005-02-04 12:23     ` Face bug in Gnus manual (Re: fontifacation not working everywhere) Károly Lőrentey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).