Gnus development mailing list
 help / color / mirror / Atom feed
From: lorentey@elte.hu (Károly Lőrentey)
Subject: Face bug in Gnus manual (Re: fontifacation not working everywhere)
Date: Fri, 04 Feb 2005 13:23:01 +0100	[thread overview]
Message-ID: <lorentey.a.l.multi-tty.878y64gx6b.elte@eris.elte.hu> (raw)
In-Reply-To: <86vfgvcjad.fsf@logolalia.com> (Dan Waber's message of "Sat, 10 Jul 2004 23:30:34 -0400")


[-- 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

           reply	other threads:[~2005-02-04 12:23 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <86vfgvcjad.fsf@logolalia.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=lorentey.a.l.multi-tty.878y64gx6b.elte@eris.elte.hu \
    --to=lorentey@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).