From: "Eli Zaretskii" <eliz@elta.co.il>
Cc: algernon@midgard.debian.net, bug-gnu-emacs@gnu.org,
psg@debian.org, 127943@bugs.debian.org
Subject: Re: Bug#127943: Bug in htmlize.el
Date: Sun, 21 Sep 2003 14:36:30 +0200 [thread overview]
Message-ID: <9003-Sun21Sep2003143629+0300-eliz@elta.co.il> (raw)
In-Reply-To: <m3smmri47b.fsf@hniksic.iskon.hr> (message from Hrvoje Niksic on Sat, 20 Sep 2003 22:40:24 +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.
next prev parent reply other threads:[~2003-09-21 12:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87r8njey31.fsf@cachemir.echo-net.net>
[not found] ` <sxsn0y61kix.fsf@florida.arsdigita.de>
[not found] ` <1197.1063152238@mixed>
[not found] ` <m3znhd54dn.fsf@xemacs.org>
[not found] ` <83k784rl0h.wl%algernon@bonehunter.rulez.org>
[not found] ` <m365jnahp7.fsf@hniksic.iskon.hr>
[not found] ` <83ad8zryyx.wl%algernon@midgard.debian.net>
2003-09-20 20:40 ` Bug#127943: Bug in htmlize.el Hrvoje Niksic
2003-09-21 12:36 ` Eli Zaretskii [this message]
2003-09-21 12:19 ` Hrvoje Niksic
2003-09-21 14:39 ` Eli Zaretskii
2003-09-21 16:27 ` Eli Zaretskii
2003-09-21 13:29 ` Richard Stallman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9003-Sun21Sep2003143629+0300-eliz@elta.co.il \
--to=eliz@elta.co.il \
--cc=127943@bugs.debian.org \
--cc=algernon@midgard.debian.net \
--cc=bug-gnu-emacs@gnu.org \
--cc=psg@debian.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).