[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (type graphic)

From: Eli Zaretskii
Subject: Re: (type graphic)
Date: Wed, 25 Oct 2000 16:28:08 +0200 (IST)

On Wed, 25 Oct 2000, Miles Bader wrote:

> Eli Zaretskii <address@hidden> writes:
> > Miles, could you please tell what does defface need to know about the 
> > display capabilities for the above distinction?  Is it a number of
> > supported colors, perhaps?  If so, we can make a better test, I think.
> I just wanted an inverse of (type tty), because sometimes it's more
> convenient to write face descriptions that way -- note the proliferation
> of (type x w32 mac), except that often w32 or mac are left out, for no
> apparent good reason.

The "(type x w32 mac)" are there primarily for hysterical reasons: they 
started as "(type x)", then the other types were added as time passed by.
They were left alone by default, not by some action.

However, if we want to change this, we might as well do it right ;-)

The Right Way (IMHO) is to realize why do we need separate face 
definitions.  After all, given the transparent mapping of X colors to tty 
colors, a single defface should work for all platforms, right?  It even
actually works that way for several faces defined by some packages, such 
as paren.el.

The only reason that I could think of that a different definition is 
required on character terminals is that they have much less colors, and 
so colors such as gray65, gray75, and gray85 all map to the same color.
(This is a real-life example: look at diff-mode.el.)

If the number of supported colors is the _only_ reason, we can simply 
test how many colors are supported, and act accordingly, or define a 
new type, say '256color, to check inside defface instead 'tty.  The 
advantage of this is that it will DTRT even if some character terminal 
supports lots of colors (I'm told that the w32 terminal can, in 
principle, do that, even if the current code doesn't yet support that).

If there are other reasons for the distinction between display types 
inside defface, let's hear them.

> * Actually (display-graphic-p FRAME) is basically equivalent to
>   "(member window-system '(x w32 mac))" in this case, which I guess
>   means that `pc' will be considered a tty.  This seems correct to me,
>   but you certainly know better....

Yes, it is correct to group pc with tty by defult.  That's not the reason 
for my comments.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]