From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.bugs Subject: Re: Bug#127943: Bug in htmlize.el Date: Sun, 21 Sep 2003 14:36:30 +0200 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <9003-Sun21Sep2003143629+0300-eliz@elta.co.il> References: <87r8njey31.fsf@cachemir.echo-net.net> <1197.1063152238@mixed> <83k784rl0h.wl%algernon@bonehunter.rulez.org> <83ad8zryyx.wl%algernon@midgard.debian.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1064144497 20899 80.91.224.253 (21 Sep 2003 11:41:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 21 Sep 2003 11:41:37 +0000 (UTC) Cc: algernon@midgard.debian.net, bug-gnu-emacs@gnu.org, psg@debian.org, 127943@bugs.debian.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 21 13:41:34 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A12as-0003S3-00 for ; Sun, 21 Sep 2003 13:41:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A12aE-00060p-Ku for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Sep 2003 07:40:54 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A12ZS-0005mz-21 for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2003 07:40:06 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A12ZP-0005lv-Fy for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2003 07:40:04 -0400 Original-Received: from [192.114.186.23] (helo=aragorn.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A12ZO-0005lS-U2 for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2003 07:40:03 -0400 Original-Received: from zaretski (pns03-196-39.inter.net.il [80.230.196.39]) by aragorn.inter.net.il (Mirapoint Messaging Server MOS 3.3.5-GR) with ESMTP id BMM59830; Sun, 21 Sep 2003 14:39:49 +0300 (IDT) Original-To: Hrvoje Niksic X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: (message from Hrvoje Niksic on Sat, 20 Sep 2003 22:40:24 +0200) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:5823 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5823 > From: Hrvoje Niksic > 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.