GNU bug report logs - #55623
29.0.50; Mention that (face-foreground 'default) can return "unspecified-fg"

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Visuwesh <visuweshm@HIDDEN>; Done: Stefan Kangas <stefan@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 55623-done <at> debbugs.gnu.org:


Received: (at 55623-done) by debbugs.gnu.org; 28 Jun 2022 21:38:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 28 17:38:04 2022
Received: from localhost ([127.0.0.1]:56571 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o6IuJ-0000Tw-NW
	for submit <at> debbugs.gnu.org; Tue, 28 Jun 2022 17:38:04 -0400
Received: from mail-pj1-f41.google.com ([209.85.216.41]:54081)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1o6IuG-0000Sr-54
 for 55623-done <at> debbugs.gnu.org; Tue, 28 Jun 2022 17:38:01 -0400
Received: by mail-pj1-f41.google.com with SMTP id d14so13801743pjs.3
 for <55623-done <at> debbugs.gnu.org>; Tue, 28 Jun 2022 14:38:00 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:in-reply-to:references:user-agent
 :mime-version:date:message-id:subject:to:cc;
 bh=RS1t42YfWMJ+pJppxZo7/8Sm2NqHlGR9d5Cvb/GqZ/M=;
 b=HKyP2fTAJ8FzDduSbq3JhwH+McV39ph2nKWuLote1hu+xxoHzAQp+7FCYEr8cc2A1w
 q15uo3FOOeMPeFb4eH8qNVUcDvcaOHRQWykZ8C+Y/cdOSgcNClnsbczpWX9bEiz6nvkA
 5k7G/P7DaL32tqfLb1XFCjkcghyQZEb1ngKnas+ifvmd+ivQvIuyk7dqLXKBxzMqQeAU
 kvNwMTmmXI40cBVSxumTSik5ny7WnXTfMf0pfijsrO5McRzyuPLbGEyDQlIhhydIGu4c
 xhwIrmDq4EJtecPr6hT3AqOs1cierSrkq9M+F9Pk5OWqCAmgrDu2wW3qM0kBZvoY4yhk
 GF5A==
X-Gm-Message-State: AJIora8DGI1jmFuENMDaOB4tFNT5l7rW7w3F/3de4nSACEpA1Yh6WsYB
 a5GAUqgMcIHUEsNJUFxxSH2/jCbWXx45M8wPSvs=
X-Google-Smtp-Source: AGRyM1sJHDVwTcRgvKglO6KzzZXtmWgdWu3iP9Lxp++p6s9me+u9V7/uGvk/khRAw1XAtmIzTZv22LevQqPdY+gtSpI=
X-Received: by 2002:a17:902:7c0d:b0:16b:7dd2:626c with SMTP id
 x13-20020a1709027c0d00b0016b7dd2626cmr6917721pll.152.1656452274431; Tue, 28
 Jun 2022 14:37:54 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 28 Jun 2022 14:37:54 -0700
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <83czfzo554.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 27 May
 2022 09:34:31 +0300")
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN> <878rqpbqxm.fsf@HIDDEN>
 <83tu9dpmlv.fsf@HIDDEN> <87o7zla5on.fsf@HIDDEN> <83pmk1pl8h.fsf@HIDDEN>
 <4a17447f-c07f-b522-67a5-c81136dd4f4e@HIDDEN> <83czfzo554.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Date: Tue, 28 Jun 2022 14:37:54 -0700
Message-ID: <CADwFkm=JyuVX54cpbYOjH7atFeADVNCRfOVag45ArMoTiBd68Q@HIDDEN>
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 55623-done
Cc: Adam Porter <adam@HIDDEN>, luangruo@HIDDEN,
 55623-done <at> debbugs.gnu.org, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Date: Fri, 27 May 2022 00:44:38 -0500
>> Cc: luangruo@HIDDEN, 55623 <at> debbugs.gnu.org
>> From: Adam Porter <adam@HIDDEN>
>>
>>    (color-gradient
>>     (color-name-to-rgb (face-foreground 'ement-room-list-very-recent
>>                                         nil 'default))
>>     (color-name-to-rgb (face-foreground 'ement-room-list-recent
>>                                         nil 'default))
>>     6)
>>
>> When running on a TTY, face-foreground returns "unspecified-fg", which
>> causes color-name-to-rgb to return nil, which causes color-gradient to
>> signal an error.
>>
>> > Technically, these colors just tell Emacs not to emit a color-changing
>> > command when it writes text to the screen, or emit a command that
>> > tells the terminal driver "reset to your default color".  But this is
>> > an implementation detail, and we cannot talk about it in the manual
>> > without explaining a lot of details about the inner workings of color
>> > support on TTY frames.
>>
>> Since the docstring says that the default face is always fully
>> specified, I thought that meant that the default face's foreground would
>> always have a defined, usable color name.  Since "unspecified-fg" is not
>> in the manual, and apparently isn't usable by, e.g. color-name-to-rgb
>> (even on a graphical frame; and by "usable", I mean that it returns an
>> expected, useful color name), it seemed like an oversight in the manual
>> to not mention that string somewhere.
>
> These special pseudo-color names _are_ usable as colors, just not in
> every situation.  For example, we cannot ask Emacs to produce RGB
> values for them, obviously.  (If these pseudo-colors were the same as
> 'unspecified', you could trust us not to introduce such pseudo-colors
> in the first place, right?)
>
>> Theoretically, if "unspecified-fg" were documented somewhere, I could
>> have known that my code needs to account for it.  I don't necessarily
>> need to know about the inner workings of color support on a TTY--only
>> that...
>>
>>    (face-foreground 'default)
>>
>> ...may return "unspecified-fg" rather than a specific color name, and
>> that, therefore...
>>
>>    (color-name-to-rgb (face-foreground 'default))
>>
>> ...may return nil rather than a color name.
>
> These pseudo-colors were already mentioned in the doc string of
> color-values, which color-name-to-rgb calls.  I've now mentioned them
> in a few more doc strings, including color-name-to-rgb and
> face-foreground.  The additional text says something like
>
>   On TTY frames, the returned color name can be "unspecified-fg",
>   which stands for the unknown default foreground color of the
>   display where the frame is displayed.
>
>> I think a sentence or two in the appropriate place could clear this up
>> and prevent users like me from running into this problem.  e.g.
>>
>>    Note that, on non-graphical frames, the default face's foreground and
>>    background colors may be unspecified; in this case, those color names
>>    may be the special values "unspecified-fg" and "unspecified-bg",
>>    respectively.  While these are in some senses legitimate color names
>>    in Emacs, not all functions that expect color names as arguments may
>>    handle these values as expected, so it may be necessary to check for
>>    these special color names before calling such functions with them.
>
> This kind of vague description is not appropriate for the manual,
> which is supposed to _explain_ stuff, not just mention it.  So I'd
> like for now to settle for the additions to the doc strings.  After
> all, this issue didn't pop up since these pseudo-colors were
> introduced in Emacs 21, so it sounds like it's important only in some
> rare cases.

It seems like this documentation bug was fixed, so I'm closing it.

If this conclusion is incorrect and this is still an issue, please reply
to this email (use "Reply to all" in your email client) and we can
reopen the bug report.




Notification sent to Visuwesh <visuweshm@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Stefan Kangas <stefan@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 27 May 2022 07:27:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 27 03:27:14 2022
Received: from localhost ([127.0.0.1]:60811 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuUNO-0007H6-38
	for submit <at> debbugs.gnu.org; Fri, 27 May 2022 03:27:14 -0400
Received: from fuchsia.ash.relay.mailchannels.net ([23.83.222.64]:64142)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1nuUNJ-0007Gu-Sy
 for 55623 <at> debbugs.gnu.org; Fri, 27 May 2022 03:27:13 -0400
X-Sender-Id: dreamhost|x-authsender|inbox@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id BBD836C20B3;
 Fri, 27 May 2022 07:27:05 +0000 (UTC)
Received: from pdx1-sub0-mail-a295.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 37DAE6C203F;
 Fri, 27 May 2022 07:27:05 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1653636425; a=rsa-sha256;
 cv=none;
 b=k0QwYrdC3y4k6zRuzxqCu/dgsauHmtHMooIQ/esdWndTeENXkSoL5PA+LKVb9bqa474dLa
 Zrx5IL7XpQrUW25/r6afn9eVCu9bYLVNyaELDwUfJwX5EwvOCj5azcErQU3GcY3tzjDiLO
 0TYQaneQbT//1+B4ts76zEdOQ6sbnINaXd9n+6QombR400h9aT5XpntLFPSFLw8qQFIN+y
 B3kkx0ljvhOqPRXPxvmQVZM2qwxFpYfKkwDLdbL1r/Yy1DKVq/6xzL/29Bi0lmntUYm6w3
 TNVxpBLtl2XEtZtKY3xuU+2Vv6tA4HxQBuSBjoUkpIEfxeNVz3+DV2w61oTJeA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1653636425;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=G2/NWTPM3h5nROmNnUUctMNmaRvy0tyEuBv2vb6LIzg=;
 b=XxmgRN7pS6K6gS87OIZX42cFQ20XdXOXWxg5MWDGGnBjhTNr2twC+yd/d5wsfInFmCkiOG
 nwYC7rEx1nx8Kyo+8CU9lFZUoU9xOPq/xy3K8+gE4ez8afzn/qExZiQDUU+Zv58izRs2Ee
 ALmF2pQEb64G2pGmDQ6wDCW6htnHo75FYOFXdYZKmIUrWCb7SRrnBR/N7C8QpO1Vl48zZh
 jO7VGrYaDD3St/fxTUI8UNFbbHBG/EGOEewMQK5SkYzg/d6yX9bAUSLEEMbaHg+ufceCQX
 dbU9qeLGb/HZwFZ7AaIjXZv2TK7CfqMLzFtZIKTnsuWmtXlC04nX1EeZv4F2Ig==
ARC-Authentication-Results: i=1; rspamd-6457b644b5-9dvcr;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|inbox@HIDDEN
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|inbox@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Obese-Chief: 0f7d4dbb72634576_1653636425471_3467871456
X-MC-Loop-Signature: 1653636425471:1738085329
X-MC-Ingress-Time: 1653636425471
Received: from pdx1-sub0-mail-a295.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.105.211.140 (trex/6.7.1); Fri, 27 May 2022 07:27:05 +0000
Received: from [10.48.0.46] (unknown [45.131.192.13])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: inbox@HIDDEN)
 by pdx1-sub0-mail-a295.dreamhost.com (Postfix) with ESMTPSA id 4L8bwS3Yt9z1Q8; 
 Fri, 27 May 2022 00:27:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1653636425;
 bh=G2/NWTPM3h5nROmNnUUctMNmaRvy0tyEuBv2vb6LIzg=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=IKjb/j6b42WPPXuU5L91EnLB1foIoAomFdIYzMVxovRgulfPiKELWkUPkvMiZm81r
 zXpbMu7UgNazp0Ng0zugivioyngS2q2VbsZdfmNeCkmHZN69SwSE/MlU7wplpTvKcW
 N3lgt9EsN+f39Xx6z4/QkzG0LNlpZnEMTPSZOSDFaw6juPNeKo1+31eSLzIRJ1Ry9i
 LfESU2T2BsMw/zlfT3VFaOxxSbRJNxUjzBbvCQ2IakQQNsn6i7XzcL3rWBS00pwzKZ
 1WeW6hThrVMYEX7HxVVU+1lPWj2OcgwL4hayzu97sVoU66TvYQMATK1vNlaGlHF5Ui
 YIAejDwOiOMKw==
Message-ID: <23f05096-b46e-18c0-2c5c-4b0744ae2191@HIDDEN>
Date: Fri, 27 May 2022 02:27:03 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.6.1
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN>
 <878rqpbqxm.fsf@HIDDEN> <83tu9dpmlv.fsf@HIDDEN>
 <87o7zla5on.fsf@HIDDEN> <83pmk1pl8h.fsf@HIDDEN>
 <4a17447f-c07f-b522-67a5-c81136dd4f4e@HIDDEN> <83czfzo554.fsf@HIDDEN>
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <83czfzo554.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, 55623 <at> debbugs.gnu.org, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

On 5/27/22 01:34, Eli Zaretskii wrote:
> These pseudo-colors were already mentioned in the doc string of
> color-values, which color-name-to-rgb calls.  I've now mentioned them
> in a few more doc strings, including color-name-to-rgb and
> face-foreground.  The additional text says something like
> 
>    On TTY frames, the returned color name can be "unspecified-fg",
>    which stands for the unknown default foreground color of the
>    display where the frame is displayed.

Thanks, Eli.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 27 May 2022 06:34:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 27 02:34:44 2022
Received: from localhost ([127.0.0.1]:60700 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuTYa-0005r5-7C
	for submit <at> debbugs.gnu.org; Fri, 27 May 2022 02:34:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46574)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nuTYY-0005qs-CH
 for 55623 <at> debbugs.gnu.org; Fri, 27 May 2022 02:34:42 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52842)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nuTYS-0008HV-Nk; Fri, 27 May 2022 02:34:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=4qepwTK4X5ANavCDzKAfEnzPKiAZU2TpA+nIArKcccU=; b=Bj2DPieeKlLu
 alfLUThIn/k9phm/FW7LVhpGuelHZ1JZRJkD0IeBKE9ByQE5qxHlbeqw6GyOXBhqBWpKM5iPTEuCj
 mbSjRsJDhvtbjFhbRxHw6mmnnLravgx603gvCjl3IHg/82tnveImt8r0D1MjmtfjN7EFzE33BsLCK
 ZxWseET18BouIZe7emx1t+cKO3cIQsv2XRkzcUoInCEUEdI1KX28Y6gY5Nsc8VC2jn5cqM4iWj48N
 qAKVddc5HE1FyNijfYIf7oA3gKuF7hgP4DIujdFLK3eTp8r6hQriuGtNOFnLi19V84sROUlIPhy0R
 bvNKt3/RTBjZtEruN35pDw==;
Received: from [87.69.77.57] (port=2116 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nuTYS-0000GL-4p; Fri, 27 May 2022 02:34:36 -0400
Date: Fri, 27 May 2022 09:34:31 +0300
Message-Id: <83czfzo554.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Adam Porter <adam@HIDDEN>
In-Reply-To: <4a17447f-c07f-b522-67a5-c81136dd4f4e@HIDDEN> (message
 from Adam Porter on Fri, 27 May 2022 00:44:38 -0500)
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN>
 <878rqpbqxm.fsf@HIDDEN> <83tu9dpmlv.fsf@HIDDEN>
 <87o7zla5on.fsf@HIDDEN> <83pmk1pl8h.fsf@HIDDEN>
 <4a17447f-c07f-b522-67a5-c81136dd4f4e@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, 55623 <at> debbugs.gnu.org, visuweshm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 27 May 2022 00:44:38 -0500
> Cc: luangruo@HIDDEN, 55623 <at> debbugs.gnu.org
> From: Adam Porter <adam@HIDDEN>
> 
>    (color-gradient
>     (color-name-to-rgb (face-foreground 'ement-room-list-very-recent
>                                         nil 'default))
>     (color-name-to-rgb (face-foreground 'ement-room-list-recent
>                                         nil 'default))
>     6)
> 
> When running on a TTY, face-foreground returns "unspecified-fg", which 
> causes color-name-to-rgb to return nil, which causes color-gradient to 
> signal an error.
> 
> > Technically, these colors just tell Emacs not to emit a color-changing
> > command when it writes text to the screen, or emit a command that
> > tells the terminal driver "reset to your default color".  But this is
> > an implementation detail, and we cannot talk about it in the manual
> > without explaining a lot of details about the inner workings of color
> > support on TTY frames.
> 
> Since the docstring says that the default face is always fully 
> specified, I thought that meant that the default face's foreground would 
> always have a defined, usable color name.  Since "unspecified-fg" is not 
> in the manual, and apparently isn't usable by, e.g. color-name-to-rgb 
> (even on a graphical frame; and by "usable", I mean that it returns an 
> expected, useful color name), it seemed like an oversight in the manual 
> to not mention that string somewhere.

These special pseudo-color names _are_ usable as colors, just not in
every situation.  For example, we cannot ask Emacs to produce RGB
values for them, obviously.  (If these pseudo-colors were the same as
'unspecified', you could trust us not to introduce such pseudo-colors
in the first place, right?)

> Theoretically, if "unspecified-fg" were documented somewhere, I could 
> have known that my code needs to account for it.  I don't necessarily 
> need to know about the inner workings of color support on a TTY--only 
> that...
> 
>    (face-foreground 'default)
> 
> ...may return "unspecified-fg" rather than a specific color name, and 
> that, therefore...
> 
>    (color-name-to-rgb (face-foreground 'default))
> 
> ...may return nil rather than a color name.

These pseudo-colors were already mentioned in the doc string of
color-values, which color-name-to-rgb calls.  I've now mentioned them
in a few more doc strings, including color-name-to-rgb and
face-foreground.  The additional text says something like

  On TTY frames, the returned color name can be "unspecified-fg",
  which stands for the unknown default foreground color of the
  display where the frame is displayed.

> I think a sentence or two in the appropriate place could clear this up 
> and prevent users like me from running into this problem.  e.g.
> 
>    Note that, on non-graphical frames, the default face's foreground and
>    background colors may be unspecified; in this case, those color names
>    may be the special values "unspecified-fg" and "unspecified-bg",
>    respectively.  While these are in some senses legitimate color names
>    in Emacs, not all functions that expect color names as arguments may
>    handle these values as expected, so it may be necessary to check for
>    these special color names before calling such functions with them.

This kind of vague description is not appropriate for the manual,
which is supposed to _explain_ stuff, not just mention it.  So I'd
like for now to settle for the additions to the doc strings.  After
all, this issue didn't pop up since these pseudo-colors were
introduced in Emacs 21, so it sounds like it's important only in some
rare cases.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 27 May 2022 05:44:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 27 01:44:51 2022
Received: from localhost ([127.0.0.1]:60650 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuSmJ-0002Ma-2O
	for submit <at> debbugs.gnu.org; Fri, 27 May 2022 01:44:51 -0400
Received: from fuchsia.ash.relay.mailchannels.net ([23.83.222.64]:14607)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1nuSmD-0002MK-0o
 for 55623 <at> debbugs.gnu.org; Fri, 27 May 2022 01:44:49 -0400
X-Sender-Id: dreamhost|x-authsender|inbox@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id E8DFB5A12FE;
 Fri, 27 May 2022 05:44:40 +0000 (UTC)
Received: from pdx1-sub0-mail-a295.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 3195C5A12AD;
 Fri, 27 May 2022 05:44:40 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1653630280; a=rsa-sha256;
 cv=none;
 b=crzmb6vGfwyZdFWRFAX5mUYt4FcHZ/eRhYnPhuSuyWJMeaKRAd18Euv8uZnQT1R5ze1e6w
 2OkNPUaLQY8hXUN/zNbeCAps1f3QpbQaLA/4vf1MZDVgQMF0cRyxD9Q1GN6VMlUuwdT5NJ
 H4m7sO6Zt4cgdf3R2wmfBsn8E2JFzUACIdXLsplfmSNZe/G1Ft3PTz8byqT9HG/bR/5tb5
 BOZeHQQXT4kMwJ7ThIk4WpVvs4RzlMFXRifN4UjOMDZEVqKSMbwzMAd5tJ5EcvBraTjqMF
 U6/QCD9qPcty5VmveT7boCPLY/sVTGiZaOQ7SCtZETSdff1qIcaIjbvIvzv86w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1653630280;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=d5uUfbNmCtLKw+rANUKhll4XsQWsR0fBCTq9AznWJFA=;
 b=h3Kahs7GjlUFrAh1dSwLMeEK0uMdbWzKlzduE1qwda9gcrx5irZb+qF0fhVh9DIYOPA2h1
 jtDWAffqSjd29fKc7THBiOB15FWwvvbVq6A+cHpE6fVwOmXs2iXftPe42OF14cuajBjjNx
 +Ryy/MMW/OOjrlSMXCOnuGpHbMrUOCfWIfxZP9RRQsFpPp7WjhY/NrtwZ4EWbJuxaotZaE
 U+432qXuFTbJCx9RE49hDNZXiN+Qvtx4KMEopo765iIFL34n2DzlS1S2l4VukTqRjLPj5+
 CNd9QR3wJlLVHCTFkNvHng//iR+yRctTsr3u6UOTju27qNr7BefuHeeu+bsN8g==
ARC-Authentication-Results: i=1; rspamd-68cf9fd8bf-jp5mw;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|inbox@HIDDEN
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|inbox@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Imminent-Whistle: 09fa9ef010dc12b1_1653630280740_1003338940
X-MC-Loop-Signature: 1653630280740:3150989889
X-MC-Ingress-Time: 1653630280739
Received: from pdx1-sub0-mail-a295.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.98.242.203 (trex/6.7.1); Fri, 27 May 2022 05:44:40 +0000
Received: from [10.48.0.46] (unknown [45.131.192.13])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: inbox@HIDDEN)
 by pdx1-sub0-mail-a295.dreamhost.com (Postfix) with ESMTPSA id 4L8YfH32QRz1Q8; 
 Thu, 26 May 2022 22:44:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1653630279;
 bh=c/DVvbp2GVmtDJK4zuaUSH5Vw2ZdGU7lwLTGqrFHTj8=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=Jnbr+n+Gj0N0sAxXGSQpWpZPnqTPqeH+G+/cM1sxZYOlbdXEc6xD39JnuVxRatAax
 Ojp/RtXfDvW7KXCfXKR8xOnQlnXQBa7rvtTN/i6IaZfLWT2Q5L9kY8czQYUYTV/fKC
 7LHCk+2FrWKONAJY7mglZuYtRykBH5hzFV7JsnW6+cSrHJM0Kcx6EDmn/Ki11xeiVo
 duMlkyO6DiGPpKjzRXetf5oRa4YlMjiYDYSvs6fL+7YYUtnqH4FEELfeIs5vgmToFT
 iVhmGhx/+0wcJZ8N9Vy5Pq7+5DBN5bgetdg44f+UAPDKEJKRG/jHR90r2Baxoml53V
 x3+cizhxD9pDw==
Message-ID: <4a17447f-c07f-b522-67a5-c81136dd4f4e@HIDDEN>
Date: Fri, 27 May 2022 00:44:38 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.6.1
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>, Visuwesh <visuweshm@HIDDEN>
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN>
 <878rqpbqxm.fsf@HIDDEN> <83tu9dpmlv.fsf@HIDDEN>
 <87o7zla5on.fsf@HIDDEN> <83pmk1pl8h.fsf@HIDDEN>
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <83pmk1pl8h.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

On 5/25/22 12:37, Eli Zaretskii wrote:
>> From: Visuwesh <visuweshm@HIDDEN>
>> Cc: luangruo@HIDDEN,  adam@HIDDEN,  55623 <at> debbugs.gnu.org
>> Date: Wed, 25 May 2022 22:52:00 +0530
>>
>> How about the following instead then?
>>
>>      The 'default' face is always fully specified except in special cases
>>      of TTY frames where :foreground and :background attributes may be
>>      the strings "unspecified-bg" and "unspecified-bg" respectively to
>>      mean to use the TTY's color for the foreground and background.
> 
> This is inaccurate and thus misleading.  These special color names are
> just like any other color names, they are "special" only when Emacs
> needs to actually use them on the screen.  For any other purposes,
> they are just color names.  Thus, the default face is "fully
> specified" even when these colors are used.  Also, these colors can be
> used by other faces, not just by 'default'.

The code in question calls color-gradient on a face's foreground color, 
using the default face as the fallback: 
https://github.com/alphapapa/ement.el/blob/fd96491e82a5335058b72aaff7665f0a2c3d4495/ement-room-list.el#L201

   (color-gradient
    (color-name-to-rgb (face-foreground 'ement-room-list-very-recent
                                        nil 'default))
    (color-name-to-rgb (face-foreground 'ement-room-list-recent
                                        nil 'default))
    6)

When running on a TTY, face-foreground returns "unspecified-fg", which 
causes color-name-to-rgb to return nil, which causes color-gradient to 
signal an error.

> Technically, these colors just tell Emacs not to emit a color-changing
> command when it writes text to the screen, or emit a command that
> tells the terminal driver "reset to your default color".  But this is
> an implementation detail, and we cannot talk about it in the manual
> without explaining a lot of details about the inner workings of color
> support on TTY frames.

Since the docstring says that the default face is always fully 
specified, I thought that meant that the default face's foreground would 
always have a defined, usable color name.  Since "unspecified-fg" is not 
in the manual, and apparently isn't usable by, e.g. color-name-to-rgb 
(even on a graphical frame; and by "usable", I mean that it returns an 
expected, useful color name), it seemed like an oversight in the manual 
to not mention that string somewhere.

Theoretically, if "unspecified-fg" were documented somewhere, I could 
have known that my code needs to account for it.  I don't necessarily 
need to know about the inner workings of color support on a TTY--only 
that...

   (face-foreground 'default)

...may return "unspecified-fg" rather than a specific color name, and 
that, therefore...

   (color-name-to-rgb (face-foreground 'default))

...may return nil rather than a color name.

I think a sentence or two in the appropriate place could clear this up 
and prevent users like me from running into this problem.  e.g.

   Note that, on non-graphical frames, the default face's foreground and
   background colors may be unspecified; in this case, those color names
   may be the special values "unspecified-fg" and "unspecified-bg",
   respectively.  While these are in some senses legitimate color names
   in Emacs, not all functions that expect color names as arguments may
   handle these values as expected, so it may be necessary to check for
   these special color names before calling such functions with them.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 17:37:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 13:37:23 2022
Received: from localhost ([127.0.0.1]:56402 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntuwk-000679-Nr
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 13:37:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34894)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ntuwf-00066t-Uy
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 13:37:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46798)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ntuwa-00033S-Jf; Wed, 25 May 2022 13:37:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=fz4Ux7rSXuJ7CRRH6kXUr/lR6/DMLyawhOg/vySJV+Y=; b=ecW2kEzXQl61
 2K9XzI9i+YLc61Ct+NDcZ6A3Hbcnv21sPXJsBxq+99l7m1nyPNU9U20a4tSadIwP3O4fbtf+bnYDl
 ZkVrTONNVtsssiZNhvSgzqiyfjVuFNHHUMMYU22WDsbGVvynpGHmJ0F8IkRFb5TGyFtj8KV2aqLHS
 siyZCo8xQexvx4eiBq2XFT9WzcfKoZCtf9yHizmf9rl3bgKeC1xxDLB0W19ZLzqWYQmaNdnY2TjmI
 YWoKzELdmIfcbMGKis5NA/uwEHKOxn3srPrHPWOEiNnmWkh/1QTOI9y5UD+9+YzF5+Y+b62wVN83h
 F0WqmtZruWERCyuiQtfU2g==;
Received: from [87.69.77.57] (port=4721 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ntuwZ-0002Ny-S0; Wed, 25 May 2022 13:37:12 -0400
Date: Wed, 25 May 2022 20:37:02 +0300
Message-Id: <83pmk1pl8h.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87o7zla5on.fsf@HIDDEN> (message from Visuwesh on Wed, 25 May
 2022 22:52:00 +0530)
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN>
 <878rqpbqxm.fsf@HIDDEN> <83tu9dpmlv.fsf@HIDDEN> <87o7zla5on.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, adam@HIDDEN, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: luangruo@HIDDEN,  adam@HIDDEN,  55623 <at> debbugs.gnu.org
> Date: Wed, 25 May 2022 22:52:00 +0530
> 
> How about the following instead then?
> 
>     The 'default' face is always fully specified except in special cases
>     of TTY frames where :foreground and :background attributes may be
>     the strings "unspecified-bg" and "unspecified-bg" respectively to
>     mean to use the TTY's color for the foreground and background.

This is inaccurate and thus misleading.  These special color names are
just like any other color names, they are "special" only when Emacs
needs to actually use them on the screen.  For any other purposes,
they are just color names.  Thus, the default face is "fully
specified" even when these colors are used.  Also, these colors can be
used by other faces, not just by 'default'.

Technically, these colors just tell Emacs not to emit a color-changing
command when it writes text to the screen, or emit a command that
tells the terminal driver "reset to your default color".  But this is
an implementation detail, and we cannot talk about it in the manual
without explaining a lot of details about the inner workings of color
support on TTY frames.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 17:22:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 13:22:22 2022
Received: from localhost ([127.0.0.1]:56385 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntuiE-0005gT-48
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 13:22:22 -0400
Received: from mail-pl1-f193.google.com ([209.85.214.193]:35493)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1ntuiB-0005g9-3a
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 13:22:21 -0400
Received: by mail-pl1-f193.google.com with SMTP id c2so19147780plh.2
 for <55623 <at> debbugs.gnu.org>; Wed, 25 May 2022 10:22:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=Vda91ljZoYGnAuE3osqJphSnSOrrZ8u+5WE8eFw+04w=;
 b=dNJku+VWQ4fTcb0cNtTR1hDGyxbRZpEWKnAYOyRSVEtAHygKNRKHdMmZ30HSj4+YMH
 j/wCSA1KeCqfq4lAzYhmyY5H0mvMrlv+ZJ5e3eRu06o/Q6Az1jgzT6KIyXN1kIuzZ3AN
 vb5ZbLOnpc8Jy5wnPUy5E7F7x0f24joYakjvU1Q1HidORKf3/hq+JGAZKKC8paXovPwB
 F8VGRiECURNkzMpo3BdvO1l8FgzoJ/qAAnv+dyuCgNhO9JZlDGXx/qj5Sem7U+Tni3Hq
 mJvBjrqzxr/VymB7X+GjMv43paYQXyeU6hCrX0PzNNpzptAoxexmj79mXetAPHdkZHt2
 XlqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=Vda91ljZoYGnAuE3osqJphSnSOrrZ8u+5WE8eFw+04w=;
 b=CC1Kk+7jEGBL0Sf3iePFmlbEFu083+HcyKqbS6/cNy/podvrL4mUYKdMhHk7S5FISr
 No8dCcyT6dUEyXPaK7DUZ/2Los6jEZwtqGZL9aTbkHyc796fVlOF9FqlUiqwwBzz4eks
 wDmnJdMeD1Lmx8lkHERXgIioRYjSZ1guU3nRVJlp4R637rtvyCRSxD3uGEMTSIdxYhGb
 dZF/jKVSk0MU/nRH9HlMMJlCFlYvN4a/MSddNPgHhC0i2xBPJwhP6dUsEy6d+UGboHFe
 L028/ql/1nKiIr826q70Gy7EBFwFm0dT27DSQNIfcj0ECygincKd+eBvfGqXrdqWmCjA
 jU+w==
X-Gm-Message-State: AOAM531H/AdHb/xHagfNXwKxkH7h6QeUrLnve5319lThSKpTvCbupYY4
 HFDLYmxx1r1rAM6r7VZTdlE=
X-Google-Smtp-Source: ABdhPJyUwVtJOy2/P6VGZN65ZYzEESdiRBoKFxJoAVSJcN5q5MqsyoWu88OoTb4z+cvGdTJ20gbw+w==
X-Received: by 2002:a17:903:32d2:b0:161:d485:613f with SMTP id
 i18-20020a17090332d200b00161d485613fmr33727186plr.173.1653499333256; 
 Wed, 25 May 2022 10:22:13 -0700 (PDT)
Received: from localhost ([49.205.86.52]) by smtp.gmail.com with ESMTPSA id
 cw25-20020a056a00451900b0050dc76281d3sm11752838pfb.173.2022.05.25.10.22.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 May 2022 10:22:12 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN>
 <878rqpbqxm.fsf@HIDDEN> <83tu9dpmlv.fsf@HIDDEN>
Date: Wed, 25 May 2022 22:52:00 +0530
In-Reply-To: <83tu9dpmlv.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 25 May
 2022 20:07:24 +0300")
Message-ID: <87o7zla5on.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, adam@HIDDEN, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=AE=E0=AF=87 25, 2022]=
 Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm@HIDDEN>
>> Cc: luangruo@HIDDEN,  55623 <at> debbugs.gnu.org, adam@HIDDEN
>> Date: Wed, 25 May 2022 20:27:41 +0530
>>=20
>> > They aren't documented on purpose: documenting them would be messy and
>> > at best will confuse anyone who isn't familiar with the internals of
>> > color support on TTY frames.  They are in effect internal
>> > implementation details which unfortunately leak outside of the
>> > internals.
>> >
>>=20
>> I agree but I think anyone who is fairly familiar with terminal
>> emulators can understand that you cannot find the terminal emulator's
>> colourscheme (for a lack of a better word) in a terminal-agnostic way.
>> Thus, I believe there won't be too much confusion if we added such a
>> text.
>
> Which "such text" did you have in mind?  The problem here is to come
> up with a useful text, which explains something without raising a lot
> more questions.
>

The text that could be added to describe these strange colour names.

>> > What would you like to be documented about these special values, and
>> > why?
>>=20
>> I would like it if some words along the lines of...
>>=20
>>     The 'default' face is always fully specified except in special cases
>>     of TTY frames where :foreground and :background attributes may be
>>     the strings "unspecified-fg" and "unspecified-bg" respectively.
>
> Without explaining the reason for these strange "color names", how can
> this be useful to anyone?
>

Which is why, I said "You could also add the implementation details, but
I leave the decision to you."  How about the following instead then?

    The 'default' face is always fully specified except in special cases
    of TTY frames where :foreground and :background attributes may be
    the strings "unspecified-bg" and "unspecified-bg" respectively to
    mean to use the TTY's color for the foreground and background.

>> As for the why: In the bug report I alluded to in the OP, ement.el
>> relied on the completeness of the default-face specification to get the
>> colour of the face which is then used to calculate a different colour
>> (similar to the rainbow coloured nicknames you often see in irc
>> clients).  This special case of the TTY frame would be handled correctly
>> if it was spelt out somewhere.  (It isn't now since the value returned is
>> a surprise.)
>
> In such rare cases, it is much easier to explain the issue to a person
> who needs to deal with it (or thinks he/she needs to) than come up
> with a description useful enough to be in the manual.
>
> They are just "special color names", that's all.

I suppose.  But I think it would be for the best if we outlined it in
the manual.  It comes as a "surprise" after all.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 17:07:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 13:07:54 2022
Received: from localhost ([127.0.0.1]:56344 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntuU4-0005FJ-Oo
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 13:07:54 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56578)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ntuU0-0005F2-Jm
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 13:07:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46378)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ntuTu-0006iw-AR; Wed, 25 May 2022 13:07:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Ig+aiFluPFf78oE1L1+AXkiU/XGz+n24kAx2q47ZbRQ=; b=PBVp35C9zxZ+
 3yu7Q3KQcr/Q5fgAf4dL2q8LuROox7SKLVXRCzwdvxze3KnvGBFNZX6jz5k5crCgMbh1Gx5tMYmlT
 8POWe5RXcO038NpCXqMC0ipuL0sGrcutsTilDG5ZOzy/JX+4x1fT77h7YXq6xXTyFl6709uPLN3/K
 FvVRbxmHKCTJGrUd0JX7Ja5yIV7k3C+b9LKR73mQNQ043ZUPCR2tHlfWnI1VoVan3IBGvire/LV9r
 aS/M3tEkKm9WO4SeYp6k/LMsZUWP69RK00/ZeyFAhcxqLld6t8IHa7bbNoguGBW6LD5JaU29vetr5
 7e72KMkGMuA+AgnLzzry/w==;
Received: from [87.69.77.57] (port=2904 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ntuTt-0002CZ-Pv; Wed, 25 May 2022 13:07:34 -0400
Date: Wed, 25 May 2022 20:07:24 +0300
Message-Id: <83tu9dpmlv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <878rqpbqxm.fsf@HIDDEN> (message from Visuwesh on Wed, 25 May
 2022 20:27:41 +0530)
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN> <878rqpbqxm.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, adam@HIDDEN, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: luangruo@HIDDEN,  55623 <at> debbugs.gnu.org, adam@HIDDEN
> Date: Wed, 25 May 2022 20:27:41 +0530
> 
> > They aren't documented on purpose: documenting them would be messy and
> > at best will confuse anyone who isn't familiar with the internals of
> > color support on TTY frames.  They are in effect internal
> > implementation details which unfortunately leak outside of the
> > internals.
> >
> 
> I agree but I think anyone who is fairly familiar with terminal
> emulators can understand that you cannot find the terminal emulator's
> colourscheme (for a lack of a better word) in a terminal-agnostic way.
> Thus, I believe there won't be too much confusion if we added such a
> text.

Which "such text" did you have in mind?  The problem here is to come
up with a useful text, which explains something without raising a lot
more questions.

> > What would you like to be documented about these special values, and
> > why?
> 
> I would like it if some words along the lines of...
> 
>     The 'default' face is always fully specified except in special cases
>     of TTY frames where :foreground and :background attributes may be
>     the strings "unspecified-fg" and "unspecified-bg" respectively.

Without explaining the reason for these strange "color names", how can
this be useful to anyone?

> As for the why: In the bug report I alluded to in the OP, ement.el
> relied on the completeness of the default-face specification to get the
> colour of the face which is then used to calculate a different colour
> (similar to the rainbow coloured nicknames you often see in irc
> clients).  This special case of the TTY frame would be handled correctly
> if it was spelt out somewhere.  (It isn't now since the value returned is
> a surprise.)

In such rare cases, it is much easier to explain the issue to a person
who needs to deal with it (or thinks he/she needs to) than come up
with a description useful enough to be in the manual.

They are just "special color names", that's all.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 14:58:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 10:58:08 2022
Received: from localhost ([127.0.0.1]:56221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntsSc-0001S3-RR
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 10:58:08 -0400
Received: from mail-pj1-f68.google.com ([209.85.216.68]:54266)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1ntsSU-0001RM-O6
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 10:58:06 -0400
Received: by mail-pj1-f68.google.com with SMTP id z11so10111932pjc.3
 for <55623 <at> debbugs.gnu.org>; Wed, 25 May 2022 07:57:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=GCSJHeD8gUnrgaQt5UFS6B1UYVnJH2GAO4QNLvLgpSk=;
 b=WQv1exf8waB+mWqaPMSYXCtDFadCmX+/pd+beiaX8XrjCKGa+c1UWPTqU+iOkQfQa6
 dNA+7eMF3acJIqOvyS38RU2sCHd/KERgtZ0rLHOnbhHirMJaY0NdIuUUpfaVxts2OTpj
 bN5NxH3Lo3KWUAXyzi6pgbB4b4UAL8UhimOQYng5pAdyJs9l3PBVfJUPMpzS/g9xsxMV
 TalKQ9mZkytlIWWab4UNKEmW3ZEUgglIWBs4aOl9PM2Qdhp7j7lE5l8okH47qgqLgzNe
 8QPSmf9sDeWC5nwtDyPiI1+JY5pdF8YhvuDb0tL6jWVGayo3dKzMnSpcU0tlsOwJX+5o
 dtZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=GCSJHeD8gUnrgaQt5UFS6B1UYVnJH2GAO4QNLvLgpSk=;
 b=MH5IVz7707Ofacn/FPzdgLQmhgwzTY6o1Ue8YUoUhXntoaGB62W2GtsOxDTCfDEycA
 lAJDJCBbdYyguTAYc/zfYF0wNvIChz0iNlSikqu/axluKLy4LPFoSmJYHkFQdThh/Zrs
 l8Lu6L0koiFBNU/L8YVwmh4yi4S6a5ffE1RPAtDqebzwx2KnY+XnaON2TLghxTaR+ORc
 7dmQVHvclO2Z5uofesWpdtaMQTp+9cr3rinj3Ip3JLdoWrM8IraV/fsS1E24VDrbAg7R
 EGakTJMC8pwigIioYgHyZwut8IwDarVDdBUKr/hd96A3CDPgFuuvTysn/u+tn1uECev8
 wT4A==
X-Gm-Message-State: AOAM5308alZJjjerJzZEYx3tvstL+Z4p7xnAYNK/NMrs0eO2H4rePERV
 gd5DCezma8DCPOCU3geq4/w=
X-Google-Smtp-Source: ABdhPJwuGcnedU2CkEeYo/+cai/U6E7zJL40BlZ7yK+oyjpJfhYpSBF+KOiaocGLbEEH3wMeVwfjVw==
X-Received: by 2002:a17:90a:a385:b0:1cb:bfa8:ae01 with SMTP id
 x5-20020a17090aa38500b001cbbfa8ae01mr10867905pjp.116.1653490672600; 
 Wed, 25 May 2022 07:57:52 -0700 (PDT)
Received: from localhost ([49.205.86.52]) by smtp.gmail.com with ESMTPSA id
 bf3-20020a170902b90300b001624965d83bsm3544777plb.228.2022.05.25.07.57.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 May 2022 07:57:51 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN> <83pmk14uo4.fsf@HIDDEN>
Date: Wed, 25 May 2022 20:27:41 +0530
In-Reply-To: <83pmk14uo4.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 25 May
 2022 16:18:51 +0300")
Message-ID: <878rqpbqxm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, adam@HIDDEN, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=AE=E0=AF=87 25, 2022]=
 Eli Zaretskii wrote:

>> Resent-From: Visuwesh <visuweshm@HIDDEN>
>> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@HIDDEN=
g>
>> Resent-CC: bug-gnu-emacs@HIDDEN
>> Resent-Sender: help-debbugs@HIDDEN
>> Cc: luangruo@HIDDEN
>> From: Visuwesh <visuweshm@HIDDEN>
>> Date: Wed, 25 May 2022 13:23:09 +0530
>>=20
>> [=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=AE=E0=AF=87 25, 20=
22] Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text edit=
ors" wrote:
>>=20
>> > Visuwesh <visuweshm@HIDDEN> writes:
>> >
>> >> In a tty frame and when using a theme that does not explicitly set the
>> >> default face's :foreground/:background [1], (face-attribute 'default =
:foreground)
>> >> returns "unspecified-fg".  This value is surprising when the docstring
>> >> of `face-attribute' says,
>> >>
>> >>     To ensure that the return value is always specified and absolute,=
 use a
>> >>     value of =E2=80=98default=E2=80=99 for INHERIT; this will resolve=
 any unspecified or
>> >>     relative values by merging with the =E2=80=98default=E2=80=99 fac=
e (which is always
>> >>     completely specified).              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^=
^^
>> >>     ^^^^^^^^^^^^^^^^^^^^^
>> >>
>> >> I opened the Elisp manual and tried to isearch for "unspecified-fg", =
but
>> >> it got me no matches.  It would be nice if this return value was
>> >> documented somewhere.
>> >
>> > Isn't that a special color which means to use the terminal's default
>> > foreground (and/or background, in the case of unspecified-bg) colors?
>> >
>> > If so, it should be documented as that instead.
>>=20
>> Indeed, "unspecified-fg/bg" means to use the terminal's default fg/bg.
>
> Right.  Thus, when the documentation talks about "unspecified values
> for attributes" and about the default face being "always completely
> specified", it excluded the "unspecified-fg" and "unspecified-bg"
> values, because those are considered "specified", except in some rare
> cases.  It is not an accident that they are strings and not symbols.
>
>> But AFAICT, it is not specified in the manual anywhere.
>
> They aren't documented on purpose: documenting them would be messy and
> at best will confuse anyone who isn't familiar with the internals of
> color support on TTY frames.  They are in effect internal
> implementation details which unfortunately leak outside of the
> internals.
>

I agree but I think anyone who is fairly familiar with terminal
emulators can understand that you cannot find the terminal emulator's
colourscheme (for a lack of a better word) in a terminal-agnostic way.
Thus, I believe there won't be too much confusion if we added such a
text.

> What would you like to be documented about these special values, and
> why?

I would like it if some words along the lines of...

    The 'default' face is always fully specified except in special cases
    of TTY frames where :foreground and :background attributes may be
    the strings "unspecified-fg" and "unspecified-bg" respectively.

in the manual somewhere.  You could also add the implementation details,
but I leave the decision to you.

As for the why: In the bug report I alluded to in the OP, ement.el
relied on the completeness of the default-face specification to get the
colour of the face which is then used to calculate a different colour
(similar to the rainbow coloured nicknames you often see in irc
clients).  This special case of the TTY frame would be handled correctly
if it was spelt out somewhere.  (It isn't now since the value returned is
a surprise.)

But since I'm kind of a third party here, maybe Adam can chime in (added
to CCs)?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 13:19:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 09:19:22 2022
Received: from localhost ([127.0.0.1]:54624 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntqv4-0004Ty-65
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 09:19:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58182)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ntqv0-0004Tk-H4
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 09:19:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60900)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ntquv-0007hF-3p; Wed, 25 May 2022 09:19:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=W3PkX5BBt1cEKPqz4HL+z2NyRMTKQec8zWaXhTHrEZo=; b=hSQxh6eX3T5FKzqjkDPe
 CvouNav+v3zXkfK+9Mjfxv/TPyaEGu2ev87sdxC0OVICGXjXgFWIB0yVP+GweIp82Na5KZkJ9jbF6
 PlUwWSkkvKYhdBiWaHTsAzwtOEqdq2JZMqyQFzgWzbD6P8rEb5iXE70VQk342vZ8gbCXHF2KZprz+
 OrSPj5Cs/3vRAMehGHNuv4U+payyE0URAaSv3fD05AJM9deeHK5txE39KWt7t7peYa0Yt9RGJPsqY
 vMAXBEz9IrRvooqBiVNJjhxz6jo2yB6KLU9kkBPWDbVRv54rdBl2451ESrR0lUdfdoVRFJOhYsfpf
 fB/xomAPBwnxiQ==;
Received: from [87.69.77.57] (port=1346 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ntquh-0007JA-TK; Wed, 25 May 2022 09:19:02 -0400
Date: Wed, 25 May 2022 16:18:51 +0300
Message-Id: <83pmk14uo4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87czg2aw0q.fsf@HIDDEN> (message from Visuwesh on Wed, 25 May
 2022 13:23:09 +0530)
Subject: Re: bug#55623: 29.0.50;
 Mention that (face-foreground 'default) can return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
 <87czg2aw0q.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55623
Cc: luangruo@HIDDEN, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Resent-From: Visuwesh <visuweshm@HIDDEN>
> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
> Resent-CC: bug-gnu-emacs@HIDDEN
> Resent-Sender: help-debbugs@HIDDEN
> Cc: luangruo@HIDDEN
> From: Visuwesh <visuweshm@HIDDEN>
> Date: Wed, 25 May 2022 13:23:09 +0530
> 
> [புதன் மே 25, 2022] Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:
> 
> > Visuwesh <visuweshm@HIDDEN> writes:
> >
> >> In a tty frame and when using a theme that does not explicitly set the
> >> default face's :foreground/:background [1], (face-attribute 'default :foreground)
> >> returns "unspecified-fg".  This value is surprising when the docstring
> >> of `face-attribute' says,
> >>
> >>     To ensure that the return value is always specified and absolute, use a
> >>     value of ‘default’ for INHERIT; this will resolve any unspecified or
> >>     relative values by merging with the ‘default’ face (which is always
> >>     completely specified).              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>     ^^^^^^^^^^^^^^^^^^^^^
> >>
> >> I opened the Elisp manual and tried to isearch for "unspecified-fg", but
> >> it got me no matches.  It would be nice if this return value was
> >> documented somewhere.
> >
> > Isn't that a special color which means to use the terminal's default
> > foreground (and/or background, in the case of unspecified-bg) colors?
> >
> > If so, it should be documented as that instead.
> 
> Indeed, "unspecified-fg/bg" means to use the terminal's default fg/bg.

Right.  Thus, when the documentation talks about "unspecified values
for attributes" and about the default face being "always completely
specified", it excluded the "unspecified-fg" and "unspecified-bg"
values, because those are considered "specified", except in some rare
cases.  It is not an accident that they are strings and not symbols.

> But AFAICT, it is not specified in the manual anywhere.

They aren't documented on purpose: documenting them would be messy and
at best will confuse anyone who isn't familiar with the internals of
color support on TTY frames.  They are in effect internal
implementation details which unfortunately leak outside of the
internals.

What would you like to be documented about these special values, and
why?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 07:53:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 03:53:39 2022
Received: from localhost ([127.0.0.1]:54244 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntlpr-0003mH-A8
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 03:53:39 -0400
Received: from mail-pj1-f68.google.com ([209.85.216.68]:41613)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1ntlpo-0003lv-Ri
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 03:53:37 -0400
Received: by mail-pj1-f68.google.com with SMTP id
 l20-20020a17090a409400b001dd2a9d555bso4364874pjg.0
 for <55623 <at> debbugs.gnu.org>; Wed, 25 May 2022 00:53:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:user-agent:date
 :message-id:mime-version:content-transfer-encoding;
 bh=3p99GETH1uyHMszuTgwFCMIPVLpW8f29Ucon5nzaCbQ=;
 b=kEoIXvJ6yOnJbX6Yj29sH3lueBKJZoA3aZo3zhZanb9lC9L1v2YOYHcJhjq+HQeNC+
 eFZii6rRE0Uv77knbv7JyoIbRPawgPbMxsBClkrZ6iqBgEcAmDQhFixbbtnTxhJhv2xp
 xf3FNDy97eo4JMll0qLzFVZoCuy436LcOCc73cYOdijNhjntWc3ccSMpYRGa2Y6aM728
 rB5VSWbSM6g7BvhKnZJvzfqPYzvEvanOktwFlVVLnYAVkRDdey54tsiEk2UXJ87mPClS
 8ENR+c4U+mQykKN5YrGwMQEZP0Uo6XJoqr+Wv98mFLhP8E54LssZgF55aajdmG5cENgt
 Ir5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references
 :user-agent:date:message-id:mime-version:content-transfer-encoding;
 bh=3p99GETH1uyHMszuTgwFCMIPVLpW8f29Ucon5nzaCbQ=;
 b=PSzGLssYohHTMMYze98lF1207e0ZvrnFKTfa3eYBP/RhSqSc+2rapERF9WEICTFpvr
 AgAGPn6YG3ptjXs6xUzN+Yt7UYweFCzCRQt2LZNs7l0Qb4hfjZLhrCN2ibRp1Ls2VvDp
 Xp26A0YYKPwNMog67S2KAp3IKeBmD7aPKlNpTlfUm9ptb8WqwjWmFc6bm0S6hgs14+q7
 DwWvmg/i6SCaIraz/w0UmB7dPoZD1E7Yd6JvCMGHqexvPXc01pZL5it1B8QRKNVOSqPg
 9FvbwAOgNlqwWsKNo9941nNnHZVDrOEkJUequP56sXn5jjPbgqM13JfbJVVFvP0KmY1H
 9p8A==
X-Gm-Message-State: AOAM533pQNfUjv8C13IeXbxUP5vEXSIWltrg0yeEoCBtbXp7719XrCR1
 MScbo2Splw7WOiFPN7AmHvo=
X-Google-Smtp-Source: ABdhPJzVN2Fbj+8dLA54O8Y6Ybp3KTzBlOmNfoDRT14yj2gdwb5xppAS/4sQJ+pvLGtux9FyZQ6cIg==
X-Received: by 2002:a17:902:ec92:b0:161:7e29:6f95 with SMTP id
 x18-20020a170902ec9200b001617e296f95mr31116296plg.12.1653465210894; 
 Wed, 25 May 2022 00:53:30 -0700 (PDT)
Received: from localhost ([49.205.86.52]) by smtp.gmail.com with ESMTPSA id
 w2-20020a170902d70200b0015e8d4eb2aesm8590421ply.248.2022.05.25.00.53.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 May 2022 00:53:30 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
In-Reply-To: <87o7zmjd2f.fsf@HIDDEN> (Po Lu via's message of "Wed, 25 May
 2022 15:17:44 +0800")
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Date: Wed, 25 May 2022 13:23:09 +0530
Message-ID: <87czg2aw0q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55623
Cc: Po Lu <luangruo@HIDDEN>, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=AE=E0=AF=87 25, 2022]=
 Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors=
" wrote:

> Visuwesh <visuweshm@HIDDEN> writes:
>
>> In a tty frame and when using a theme that does not explicitly set the
>> default face's :foreground/:background [1], (face-attribute 'default :fo=
reground)
>> returns "unspecified-fg".  This value is surprising when the docstring
>> of `face-attribute' says,
>>
>>     To ensure that the return value is always specified and absolute, us=
e a
>>     value of =E2=80=98default=E2=80=99 for INHERIT; this will resolve an=
y unspecified or
>>     relative values by merging with the =E2=80=98default=E2=80=99 face (=
which is always
>>     completely specified).              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>     ^^^^^^^^^^^^^^^^^^^^^
>>
>> I opened the Elisp manual and tried to isearch for "unspecified-fg", but
>> it got me no matches.  It would be nice if this return value was
>> documented somewhere.
>
> Isn't that a special color which means to use the terminal's default
> foreground (and/or background, in the case of unspecified-bg) colors?
>
> If so, it should be documented as that instead.

Indeed, "unspecified-fg/bg" means to use the terminal's default fg/bg.
But AFAICT, it is not specified in the manual anywhere.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 May 2022 07:53:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 03:53:39 2022
Received: from localhost ([127.0.0.1]:54242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntlpr-0003mF-23
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 03:53:39 -0400
Received: from lists.gnu.org ([209.51.188.17]:48938)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1ntlpo-0003m1-Ua
 for submit <at> debbugs.gnu.org; Wed, 25 May 2022 03:53:37 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44878)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <visuweshm@HIDDEN>)
 id 1ntlpn-0002aI-Ly
 for bug-gnu-emacs@HIDDEN; Wed, 25 May 2022 03:53:35 -0400
Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:46894)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <visuweshm@HIDDEN>)
 id 1ntlpk-0000gb-WF
 for bug-gnu-emacs@HIDDEN; Wed, 25 May 2022 03:53:35 -0400
Received: by mail-pj1-x1043.google.com with SMTP id
 v5-20020a17090a7c0500b001df84fa82f8so4319718pjf.5
 for <bug-gnu-emacs@HIDDEN>; Wed, 25 May 2022 00:53:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:user-agent:date
 :message-id:mime-version:content-transfer-encoding;
 bh=3p99GETH1uyHMszuTgwFCMIPVLpW8f29Ucon5nzaCbQ=;
 b=kEoIXvJ6yOnJbX6Yj29sH3lueBKJZoA3aZo3zhZanb9lC9L1v2YOYHcJhjq+HQeNC+
 eFZii6rRE0Uv77knbv7JyoIbRPawgPbMxsBClkrZ6iqBgEcAmDQhFixbbtnTxhJhv2xp
 xf3FNDy97eo4JMll0qLzFVZoCuy436LcOCc73cYOdijNhjntWc3ccSMpYRGa2Y6aM728
 rB5VSWbSM6g7BvhKnZJvzfqPYzvEvanOktwFlVVLnYAVkRDdey54tsiEk2UXJ87mPClS
 8ENR+c4U+mQykKN5YrGwMQEZP0Uo6XJoqr+Wv98mFLhP8E54LssZgF55aajdmG5cENgt
 Ir5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references
 :user-agent:date:message-id:mime-version:content-transfer-encoding;
 bh=3p99GETH1uyHMszuTgwFCMIPVLpW8f29Ucon5nzaCbQ=;
 b=bkjQ8kz1kjSA8NqpBtgrL0A6nisQf93NCctK09lKYsXIl8bGfZ+jM7KhEgCNptbmQ+
 wPcBq/PgpByAd05U3AF8FFSFB36hH9d9ITvJACJ+I4XvRsBQoQlHcFyW47QWTM2tuNee
 JtkXt77sxOJdpxkUFjTWFWSAn5ZI7GQ7A2WjwfsEw+AiQDbxzL/jFhdWijWVyGLEE4Pv
 G0lBhQ4lT1HyQCvkUVfjJ7KqB1Qow8QL2UjmF618Pb7xC3NlX3qcKYNrWOnsTSwGyhiB
 nLkIwcSGtzr6KIS48MNq2D/vf/w6P8bkbphBIc3yCAARcQq/9Rbc0i53BRjRyiaf1ml2
 fINQ==
X-Gm-Message-State: AOAM530VJvGs86U4Z2f7qn8mNKDkkE1QWsQq3l73W8b2xHIXep4ZBVkG
 3yFm+FPYvWf6jorokEzZQf2RFRZkUYo=
X-Google-Smtp-Source: ABdhPJzVN2Fbj+8dLA54O8Y6Ybp3KTzBlOmNfoDRT14yj2gdwb5xppAS/4sQJ+pvLGtux9FyZQ6cIg==
X-Received: by 2002:a17:902:ec92:b0:161:7e29:6f95 with SMTP id
 x18-20020a170902ec9200b001617e296f95mr31116296plg.12.1653465210894; 
 Wed, 25 May 2022 00:53:30 -0700 (PDT)
Received: from localhost ([49.205.86.52]) by smtp.gmail.com with ESMTPSA id
 w2-20020a170902d70200b0015e8d4eb2aesm8590421ply.248.2022.05.25.00.53.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 May 2022 00:53:30 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
In-Reply-To: <87o7zmjd2f.fsf@HIDDEN> (Po Lu via's message of "Wed, 25 May
 2022 15:17:44 +0800")
References: <87ilpub287.fsf@HIDDEN> <87o7zmjd2f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Date: Wed, 25 May 2022 13:23:09 +0530
Message-ID: <87czg2aw0q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2607:f8b0:4864:20::1043;
 envelope-from=visuweshm@HIDDEN; helo=mail-pj1-x1043.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Po Lu <luangruo@HIDDEN>, 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

[=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=AE=E0=AF=87 25, 2022]=
 Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors=
" wrote:

> Visuwesh <visuweshm@HIDDEN> writes:
>
>> In a tty frame and when using a theme that does not explicitly set the
>> default face's :foreground/:background [1], (face-attribute 'default :fo=
reground)
>> returns "unspecified-fg".  This value is surprising when the docstring
>> of `face-attribute' says,
>>
>>     To ensure that the return value is always specified and absolute, us=
e a
>>     value of =E2=80=98default=E2=80=99 for INHERIT; this will resolve an=
y unspecified or
>>     relative values by merging with the =E2=80=98default=E2=80=99 face (=
which is always
>>     completely specified).              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>     ^^^^^^^^^^^^^^^^^^^^^
>>
>> I opened the Elisp manual and tried to isearch for "unspecified-fg", but
>> it got me no matches.  It would be nice if this return value was
>> documented somewhere.
>
> Isn't that a special color which means to use the terminal's default
> foreground (and/or background, in the case of unspecified-bg) colors?
>
> If so, it should be documented as that instead.

Indeed, "unspecified-fg/bg" means to use the terminal's default fg/bg.
But AFAICT, it is not specified in the manual anywhere.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at 55623 <at> debbugs.gnu.org:


Received: (at 55623) by debbugs.gnu.org; 25 May 2022 07:18:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 03:18:02 2022
Received: from localhost ([127.0.0.1]:54183 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntlHN-0002pZ-SW
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 03:18:02 -0400
Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:45451)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1ntlHL-0002oz-10
 for 55623 <at> debbugs.gnu.org; Wed, 25 May 2022 03:18:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1653463072; bh=xWgh3M/oRcM8DXKuPpKpiuIFf+N0mHuzdbtYpMHJ/nw=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=CWt5amnfvAwRoABKvF3XikoCNqVFCctI26bgpj3elvsy1cgU7QcYQlHL619MkeYTStlDU1D5czceckSnGVYJNSFDwTZ6xEwr8EKn5koKOJHoEYRko/Sctorc8QYxiyO5WctmSDHi8vzUOymQ8ytBOpmI1DcLyL1ZVfbqWuXGdW7fU/DoC6WPCbgzsvjsKlbx/R4AVxJg0ArMhFqg4mRUKNi20VdnwLTYQPa/KzgdpeCauuG5L2vPC7x0MAGO6F1t/fXeK2arWzKcxp5hU8I33fmABWUpN8FBHgdH63twkbuZU59iEhyjoj8Ei+GcYZN2zJ06cjO47h0wkRrH7Md8ag==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1653463072; bh=/Kwa2c4E04n9gaWj3oQdD5DlgrrxUAr2y26K/YCxwml=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=G7pBjDrJjc0eQG40gUIysvFAqt1DniW2qcCDwyZbYQPiy2esh3cj2c68df1YfcZl+yvl9SPgznOfULTtL2G7+ZrUK6IdkMIJgTLRd0eksge0xVm3nh1kNl69oHr2sk4aCySvTHkPdwbVZ8XD/+ZwWo4HOCMiaE6pmgonkXuxyNUOE5FJmLPRlG0q7jSNu4VQOX6AC+x9A4kdR7+BbqtkZLjA7fzlTxsADjJoG8ITIXT2oWCTxVm8Z7NfAChwbsedGRVLDQI2PmjaoUHiPQcYKVVlVRS70OedLNwY5Md9xC3QEwEHoYucLggIk8Tn8/6E3xL9sf2N/a6q/IPolBQh5w==
X-YMail-OSG: n98hcHIVM1lxNiGdnEs6jH1Vjx7ZKa53SNNdKfzpaJxBYUDmUdeCxRjRQFdbidH
 bPnyVXwGKILXcKzn8fHDHMy1H9quN2JPv12WyUaKyuR.qjXGPLsU78oLgJcQFoGmOsD15zqhipuB
 Stt.wolP3LPJ8FsRhIRV.8v5l809uy_sVeB5H5s8u4DPUTS_xCLAtXNHutiyRX4fbg6tvqRrKWF8
 s4PNkFI7m4jCkkUH0wznwPyTznVq9xQ85g2GkVjGoNaCibFbGqb95qUHD7LeZfHD9FSft95K0Seh
 YquPRN76kvTrxDEMew6PbLJqn5qzsWNyutoqIcAX3P0JeL1JmP.7TLoXj2ECqC7p7tNkiJy4QKZK
 lPYKjilQNagaAXcxghQ4f1enRxzWyU67vMel.BCgPIYLiqIXCM7ebi2xIXguPQ2TKMxG0gMHyYPJ
 QCZeFO2wn4_2F6aK8pEzF6BpnTj..bDBU0tLPRmCljqyDgVxkMCLN3fWiSZ6vmK1BsCSX5D51ejs
 i.Vx5iCcdhx5bbRKpX4x9AwNzdC_1ZWI8N2Nzoe6dyJ2OuBC4LVQ4voslQT_L07moJPkEj4jZRLg
 hFmb5b_yFh.4NvXIFQC7ztIyzVyEppj_rhUlWc.gC7bkX3FcT520cEKaWybzRUrSAFkRuKuhpwpS
 ip_dF9yxqTgLVycnMvOGWyU4eUyt2bkN7Na8a_6PvK3OFXuvaXWuiwouGBhIay07FV5tSe_nE11A
 G3g83_dSi7lh8pLtwY6JAZAzoLF54VvcL0Aymp38_Z.4_mHx8rNcKEr4xR1SiZW7Ay.yHE4gTz8B
 rCk.bHAUEFJzkxtU52gQs7PhGlglnbg9bO_lH9POJK8OOcld9Wo4s.yAJp3tl6B29XI6MWFcGnMa
 7XAHMT5EPo.D9XbFDTWwEwfbIuZUc5euGPRkzHr63K74qz0MvLL0ahz86asp_RNd7TScSeCEiwWc
 PRRw5.qonFsVS69APHxh1Yic.jI2c.8NSbjCU7KsclLpNhcXYBsFR7ah9fq99MnMPWoqeGINZgZZ
 eWY9xVaXoLXu5uiU.Oyhj7WZr.zQJ5HRg0l219o.jW3irM7zyrQsO0sZIX8UFn_ekVbtXXdvYg9e
 6S0tu5Nyhu2FzRSoe5vUEPzq6kYCK9WegYDOY8iXi.mz0c3jfiD_zKQN7gsYFweXNPZbnxxV2.la
 1aogrFi4l7badfRxsYknRqJLQIa8uZxETcv3yf5wTxzpw15bmBudd.YK1VXLQhhCQ7fQRcBtJuoO
 bqiFgDaOsdV2FYUbGpnjuHoKzGRXrIYW.Jlj5zbP7vNlPwSNAdRK4X7AOjTpAfJ.HjTKR1ah_uOB
 hax72aWSnjPYrgs4IkhMoAP7UWIPwqM3TnRQdRASqWxx6x65J1D5.dKdRe2DyOYaM6SwnJmkTt7b
 eE8_Ge4eo8mq29hOqxVw41zAAFVO4T4Qj9tJZZ8550A0Kz4LBu1cv.g3WDQkjj3QDiLAaYndzGu5
 UPlUhYg.sj0SKKb9SGHLxy_89w4dRUSKfmMjbr3TMS7GEJXG5h8q7WibmZyy0MbJ85WyJbWKcnp7
 TQd2RIIcQzdoy4pXK0G65CZHzBdEEFUWii2WmgE06LZwLPTAVmZ5BoJrmKxL52GobZGfT1TmnnJk
 2Z3fj5ZSD3CND9hFkswFRdp7L6gKJ8PaNFjw9G1oGXzJd3Mi5w2AzG9VTsYo8HDdtD_PcBjKPGse
 8SXbfOpu1hzvhHCWsHqrQuWdNZpYUFBbl44Xbx_M5ZSaen.spMT.apu4wa.l7gHCD9F5pc2jKxrY
 cf3KHWWB8gB7QrSY96GHkOrkhDHSNi86.Z9oXa17NmiXQBOy3ExEPxuSzI2vEiOQySOIn7OWTq67
 LCwCj4V5XVG2_RW58ubDjxpUDdAtj6BWnMgMXYvWdcpyy.C568u33VZGslgRa6on8plDjiwwFZxn
 2WkGei5YA9wqw8gp78mTVdn5aa815OG7pwa.XbPg4CAbIOOolS8HiK6LcC4GTqjB.Yym7zO9lUBM
 EmmlqsV4x8SHMX58TTRX0Hnswnyn6kGAzDq.PNvHb3XJkHaKvIjnWy6g_FBKFB.UFN3DRagIAORL
 xOBv6WkoqNS6tm6sCVNUjop7PZzx3JTJOzNvHvYWYuDsJdIlPYPmAqgUgNsdqn7Hqq6lxBg2Dxk7
 jf61poDc3Xl95JZcJiJM6anYD4lPRG2d6cDD_enu2amb0nBeYJE8EXCxk4dco6l92uAnDsQEenF6
 Hx.nuCcLU7Wu2.vvsv.bW5g98uQIzR5uFnQBYlpU6mbdiwtuTQa0auSZFi.MMyz4-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 25 May 2022 07:17:52 +0000
Received: by hermes--canary-production-sg3-7959d4d9bd-lwwxg (Yahoo Inc. Hermes
 SMTP Server) with ESMTPA ID 1d4b3a5f802016b1799820632f248240; 
 Wed, 25 May 2022 07:17:48 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
Subject: Re: bug#55623: 29.0.50; Mention that (face-foreground 'default) can
 return "unspecified-fg"
References: <87ilpub287.fsf@HIDDEN>
Date: Wed, 25 May 2022 15:17:44 +0800
In-Reply-To: <87ilpub287.fsf@HIDDEN> (Visuwesh's message of "Wed, 25 May
 2022 11:09:04 +0530")
Message-ID: <87o7zmjd2f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailer: WebService/1.1.20225
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 1026
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55623
Cc: 55623 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Visuwesh <visuweshm@HIDDEN> writes:

> In a tty frame and when using a theme that does not explicitly set the
> default face's :foreground/:background [1], (face-attribute 'default :for=
eground)
> returns "unspecified-fg".  This value is surprising when the docstring
> of `face-attribute' says,
>
>     To ensure that the return value is always specified and absolute, use=
 a
>     value of =E2=80=98default=E2=80=99 for INHERIT; this will resolve any=
 unspecified or
>     relative values by merging with the =E2=80=98default=E2=80=99 face (w=
hich is always
>     completely specified).              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     ^^^^^^^^^^^^^^^^^^^^^
>
> I opened the Elisp manual and tried to isearch for "unspecified-fg", but
> it got me no matches.  It would be nice if this return value was
> documented somewhere.

Isn't that a special color which means to use the terminal's default
foreground (and/or background, in the case of unspecified-bg) colors?

If so, it should be documented as that instead.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 May 2022 05:39:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 01:39:30 2022
Received: from localhost ([127.0.0.1]:54110 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntjk2-0000OZ-Lo
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 01:39:30 -0400
Received: from lists.gnu.org ([209.51.188.17]:51982)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1ntjk0-0000OR-Ud
 for submit <at> debbugs.gnu.org; Wed, 25 May 2022 01:39:29 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50730)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <visuweshm@HIDDEN>)
 id 1ntjk0-00038N-Mk
 for bug-gnu-emacs@HIDDEN; Wed, 25 May 2022 01:39:28 -0400
Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:38669)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <visuweshm@HIDDEN>)
 id 1ntjjy-0004La-Uz
 for bug-gnu-emacs@HIDDEN; Wed, 25 May 2022 01:39:28 -0400
Received: by mail-pg1-x541.google.com with SMTP id 137so18065064pgb.5
 for <bug-gnu-emacs@HIDDEN>; Tue, 24 May 2022 22:39:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=QgpvlX+agNRpZKt1xcx+EdH215VDV5+hg3xiF+kI/Wc=;
 b=SeTPhJkq0jKb93GOXRPzaghGMOr1qL7N3lknY2MUuOX74vhXKwwYfHUqXggcOLqjCU
 hY9uucnGeKFnMQ2sZwyPhOKUWROX/DFeD3r3Ijy31rOMyqXGzqk3izJGBXb3oKa+a1WI
 Ro0xDsQNXzdwzueOSMbSyJEiFycWJy6oXLFQYrwbFyGSwomYRB4hJuJUQZk5iPKwTkJi
 NTma0UwMBduzh+ZJ/epj+7jCfIZK+tFp/Q3TlpX3ZiELoToFXde0kOvP9i5+o03d0yz+
 zHI760iLA8UxSJOEpbqgx4YtGQ9sDgOqQBHe3dE6G0/HZKMvwoqx+93gvBHTtUVzVMl0
 9l5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=QgpvlX+agNRpZKt1xcx+EdH215VDV5+hg3xiF+kI/Wc=;
 b=7mQh0yajtFY7d4Jtkct4hFD+2lF1QKvH7CLq+povoUBQE5RqKbutd/g0IZkYocEG4Y
 PBhIJOMw31dJjOlD51jFJDRBerfvW0aFJN29Iuds/V61lEUDlIYZaGrzK6wV65feRwmC
 1GQBin9NICm2OnIG4MDbrx9sU2gb7miFtAhz7aA7Xr3DYqMIyrbvvpfYMQ+JL483EK7j
 9fj6vfDmtdDfo0YF6lTCHkdSGH8ebhuo2tOOTyskaZ2fvyqCCDbcxASosnWqev87ahiK
 kkPC2EhTIa86+EVNtDXpceUd0yZ3TzDCYyMFH4eSrfoN3UGExZFg9kxdQ1vezaXaG5e8
 c/vg==
X-Gm-Message-State: AOAM532990b15CBuiEXvD85W6nn+EAer3YuFzOomRW9yBT+3vUTsjQMa
 RO3F6px9fgrbVWajjuLicbUl0vBMlllYAQ==
X-Google-Smtp-Source: ABdhPJxSDqWfF/bsMrWULhWAr38XqJjqjpkqBA6Gti8uMx1szsmtK27nFegpshhatzdUhRkFaXl7bA==
X-Received: by 2002:a65:6a47:0:b0:3f5:d7a8:44ee with SMTP id
 o7-20020a656a47000000b003f5d7a844eemr27278642pgu.330.1653457158543; 
 Tue, 24 May 2022 22:39:18 -0700 (PDT)
Received: from localhost ([49.205.86.52]) by smtp.gmail.com with ESMTPSA id
 x17-20020a170902821100b0015e8d4eb2a8sm8103910pln.242.2022.05.24.22.39.16
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 May 2022 22:39:17 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; Mention that (face-foreground 'default) can return
 "unspecified-fg"
Date: Wed, 25 May 2022 11:09:04 +0530
Message-ID: <87ilpub287.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2607:f8b0:4864:20::541;
 envelope-from=visuweshm@HIDDEN; helo=mail-pg1-x541.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

In a tty frame and when using a theme that does not explicitly set the
default face's :foreground/:background [1], (face-attribute 'default :foreg=
round)
returns "unspecified-fg".  This value is surprising when the docstring
of `face-attribute' says,

    To ensure that the return value is always specified and absolute, use a
    value of =E2=80=98default=E2=80=99 for INHERIT; this will resolve any u=
nspecified or
    relative values by merging with the =E2=80=98default=E2=80=99 face (whi=
ch is always
    completely specified).              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ^^^^^^^^^^^^^^^^^^^^^

I opened the Elisp manual and tried to isearch for "unspecified-fg", but
it got me no matches.  It would be nice if this return value was
documented somewhere.



[1] If I use the adwaita theme instead, then `face-foreground' does
    indeed return a colour.

P.S. I'm filing this bug report after this was brought up in
https://github.com/alphapapa/ement.el/issues/34#issuecomment-906893756.




Acknowledgement sent to Visuwesh <visuweshm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#55623; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 28 Jun 2022 21:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.