bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Bug#127943: Bug in htmlize.el


From: Eli Zaretskii
Subject: Re: Bug#127943: Bug in htmlize.el
Date: Sun, 21 Sep 2003 14:36:30 +0200

> From: Hrvoje Niksic <hniksic@xemacs.org>
> Date: Sat, 20 Sep 2003 22:40:24 +0200
> 
> >> (or (face-foreground 'default)
> >>     (cdr (assq 'foreground-color (frame-parameters)))
> >>     "black")
> >> 
> >
> > "unspecified-fg"
> >
> >> Does it really return "unspecified-fg"?  If so, I'd like to know which
> >> one evaluates to that:
> >> 
> >>     (face-foreground 'default)
> >
> > This one does.
> >  
> >> or:
> >> 
> >>     (cdr (assq 'foreground-color (frame-parameters)))
> >
> > And this too.
> 
> I wonder... is this an Emacs bug?

No, Emacs does so by design.  unspecified-fg and unspecified-bg are
the two colors that the color support uses on text terminal for the
foreground and background colors that the terminal used before Emacs
starts.  IIRC (and AFAIK) most Unix text terminals don't allow you to
query them about those colors, so their names and RGB values are
unknown to Emacs.

An Emacs started with "emacs -nw -q" should not change the default
colors of the terminal, it should preserve the fore- and background
colors that existed before start-up.  But it should still know that
there _are_ colors, and that they are supported by the terminal.

> How is a Lisp program supposed to interpret "unspecified-fg" as
> color?

It depends on the context; I don't think there's one answer to that
question.  Please tell more about the context in this particular case.
Specifically, why do you need to interpret the color names at all?

In general, the color names are to be interpreted by the Emacs
primitives, not by Lisp programs.  The primitives know about these two
special names, and use the `op' capability of the terminal to reset
the colors to the original ones.

There are a few exceptions to this rule, though; see faces.el.  But
the ``interpretation'' employed by faces.el is quite simple.

> Why don't these functions return nil instead?

Because nil means no color at all.  

> Is (face-foreground 'default) supposed to return "unspecified-fg"?

If the terminal doesn't allow to query its default colors, then yes.




reply via email to

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