From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#55623: 29.0.50; Mention that (face-foreground 'default) can return "unspecified-fg" Date: Wed, 25 May 2022 20:27:41 +0530 Message-ID: <878rqpbqxm.fsf@gmail.com> References: <87ilpub287.fsf@gmail.com> <87o7zmjd2f.fsf@yahoo.com> <87czg2aw0q.fsf@gmail.com> <83pmk14uo4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2379"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: luangruo@yahoo.com, adam@alphapapa.net, 55623@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 25 17:09:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntsdP-0000Hf-Ux for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 May 2022 17:09:16 +0200 Original-Received: from localhost ([::1]:54298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntsdO-0001vU-VX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 May 2022 11:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntsTW-0004G8-AR for bug-gnu-emacs@gnu.org; Wed, 25 May 2022 10:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntsTW-000175-0n for bug-gnu-emacs@gnu.org; Wed, 25 May 2022 10:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntsTV-0001TT-Uq for bug-gnu-emacs@gnu.org; Wed, 25 May 2022 10:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 May 2022 14:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55623 X-GNU-PR-Package: emacs Original-Received: via spool by 55623-submit@debbugs.gnu.org id=B55623.16534906885588 (code B ref 55623); Wed, 25 May 2022 14:59:01 +0000 Original-Received: (at 55623) by debbugs.gnu.org; 25 May 2022 14:58:08 +0000 Original-Received: from localhost ([127.0.0.1]:56221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntsSc-0001S3-RR for submit@debbugs.gnu.org; Wed, 25 May 2022 10:58:08 -0400 Original-Received: from mail-pj1-f68.google.com ([209.85.216.68]:54266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntsSU-0001RM-O6 for 55623@debbugs.gnu.org; Wed, 25 May 2022 10:58:06 -0400 Original-Received: by mail-pj1-f68.google.com with SMTP id z11so10111932pjc.3 for <55623@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) Original-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) In-Reply-To: <83pmk14uo4.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 25 May 2022 16:18:51 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233066 Archived-At: [=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 >> Original-Sender: "Debbugs-submit" >> Resent-CC: bug-gnu-emacs@gnu.org >> Resent-Sender: help-debbugs@gnu.org >> Cc: luangruo@yahoo.com >> From: Visuwesh >> 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 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)?