GNU bug report logs - #64759
Broken faces

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 21 Jul 2023 06:41:02 UTC

Severity: normal

To reply to this bug, email your comments to 64759 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 06:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Jul 2023 06:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Broken faces
Date: Fri, 21 Jul 2023 09:37:30 +0300
This change broke display of `display-time-date-and-time' on the tab-bar:

  diff --git a/lisp/time.el b/lisp/time.el
  index 522bec46ac6..0184f96fcc2 100644
  --- a/lisp/time.el
  +++ b/lisp/time.el
  @@ -141,6 +141,7 @@ display-time-mail-face
   (defface display-time-date-and-time nil
     "Face for `display-time-format'."
  +  '((t (:inherit mode-line)))
     :group 'mode-line-faces
     :version "30.1")

This face is used by `tab-bar-format-global' that has nothing to do
with the mode line, so inheriting from `mode-line' makes no sense.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 07:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 09:50:39 +0200
>>>>> On Fri, 21 Jul 2023 09:37:30 +0300, Juri Linkov <juri <at> linkov.net> said:

    Juri> This change broke display of `display-time-date-and-time' on the tab-bar:
    Juri>   diff --git a/lisp/time.el b/lisp/time.el
    Juri>   index 522bec46ac6..0184f96fcc2 100644
    Juri>   --- a/lisp/time.el
    Juri>   +++ b/lisp/time.el
    Juri>   @@ -141,6 +141,7 @@ display-time-mail-face
    Juri>    (defface display-time-date-and-time nil
    Juri>      "Face for `display-time-format'."
    Juri>   +  '((t (:inherit mode-line)))
    Juri>      :group 'mode-line-faces
    Juri>      :version "30.1")

Thatʼs from before 5513f72d3c8, no?

    Juri> This face is used by `tab-bar-format-global' that has nothing to do
    Juri> with the mode line, so inheriting from `mode-line' makes no sense.

Surely other items in the mode-line use the `mode-line' face already,
why is this one different?

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 07:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 10:51:55 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Date: Fri, 21 Jul 2023 09:37:30 +0300
> 
> This change broke display of `display-time-date-and-time' on the tab-bar:
> 
>   diff --git a/lisp/time.el b/lisp/time.el
>   index 522bec46ac6..0184f96fcc2 100644
>   --- a/lisp/time.el
>   +++ b/lisp/time.el
>   @@ -141,6 +141,7 @@ display-time-mail-face
>    (defface display-time-date-and-time nil
>      "Face for `display-time-format'."
>   +  '((t (:inherit mode-line)))
>      :group 'mode-line-faces
>      :version "30.1")
> 
> This face is used by `tab-bar-format-global' that has nothing to do
> with the mode line, so inheriting from `mode-line' makes no sense.

??? It is AFAIU used whenever display-time-mode shows the time when
display-time-day-and-date is non-nil.  Where this is shown doesn't
matter, and by default this is shown on the mode line.  Thus "makes no
sense" sounds somewhat harsh to me.

But feel free to change the face definition as you see fit.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 08:24:01 GMT) Full text and rfc822 format available.

Message #14 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 11:13:13 +0300
>> This change broke display of `display-time-date-and-time' on the tab-bar:
>>
>>   diff --git a/lisp/time.el b/lisp/time.el
>>   index 522bec46ac6..0184f96fcc2 100644
>>   --- a/lisp/time.el
>>   +++ b/lisp/time.el
>>   @@ -141,6 +141,7 @@ display-time-mail-face
>>    (defface display-time-date-and-time nil
>>      "Face for `display-time-format'."
>>   +  '((t (:inherit mode-line)))
>>      :group 'mode-line-faces
>>      :version "30.1")
>>
>> This face is used by `tab-bar-format-global' that has nothing to do
>> with the mode line, so inheriting from `mode-line' makes no sense.
>
> ??? It is AFAIU used whenever display-time-mode shows the time when
> display-time-day-and-date is non-nil.  Where this is shown doesn't
> matter, and by default this is shown on the mode line.  Thus "makes no
> sense" sounds somewhat harsh to me.

Sorry, I agree it makes sense when shown on the mode line.

> But feel free to change the face definition as you see fit.

It seems adding non-empty definitions in bug#64655
were intended to workaround a bug in cus-edit.el,
not to fix it.

Maybe Mauro could help to fix it (Cc'ed)
without requiring non-nil definitions
that anyway can not be fixed outside of
the Emacs source tree, i.e. in numerous
user init files and external packages.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 08:25:02 GMT) Full text and rfc822 format available.

Message #17 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 64759 <at> debbugs.gnu.org
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 11:13:52 +0300
>> This change broke display of `display-time-date-and-time' on the tab-bar:
>>   diff --git a/lisp/time.el b/lisp/time.el
>>   index 522bec46ac6..0184f96fcc2 100644
>>   --- a/lisp/time.el
>>   +++ b/lisp/time.el
>>   @@ -141,6 +141,7 @@ display-time-mail-face
>>    (defface display-time-date-and-time nil
>>      "Face for `display-time-format'."
>>   +  '((t (:inherit mode-line)))
>>      :group 'mode-line-faces
>>      :version "30.1")
>
> Thatʼs from before 5513f72d3c8, no?

5513f72d3c8 fixed a breakage, but the problem still remains.

>> This face is used by `tab-bar-format-global' that has nothing to do
>> with the mode line, so inheriting from `mode-line' makes no sense.
>
> Surely other items in the mode-line use the `mode-line' face already,
> why is this one different?

Because it's used on the tab bar.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 10:49:02 GMT) Full text and rfc822 format available.

Message #20 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 07:48:30 -0300
Juri Linkov <juri <at> linkov.net> writes:

> It seems adding non-empty definitions in bug#64655
> were intended to workaround a bug in cus-edit.el,
> not to fix it.
>
> Maybe Mauro could help to fix it (Cc'ed)
> without requiring non-nil definitions
> that anyway can not be fixed outside of
> the Emacs source tree, i.e. in numerous
> user init files and external packages.

I don't think it is a bug in Custom.  Custom will allow the user to edit
the face and set/save or whatever, even if it's definition is
(defface foo nil "...")

But it seems to me that it's better to define it like this:
(defface foo '((t nil)) "...")
so that the face gets a face-defface-spec property.

So maybe the definition for display-time-date-and-time should be changed
to:
(defface display-time-date-and-time
  '((t nil))
  "Face for `display-time-format'."
  :group 'mode-line-faces
  :version "30.1")

instead that making it inherit from mode-line?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 10:54:01 GMT) Full text and rfc822 format available.

Message #23 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 13:53:29 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 64759 <at> debbugs.gnu.org,  Mauro Aranda <maurooaranda <at> gmail.com>
> Date: Fri, 21 Jul 2023 11:13:13 +0300
> 
> It seems adding non-empty definitions in bug#64655
> were intended to workaround a bug in cus-edit.el,
> not to fix it.

I don't think it's a bug.  Why is it a bug to tell the user that the
face has no information to show as the current definition?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 10:55:02 GMT) Full text and rfc822 format available.

Message #26 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 13:54:33 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 64759 <at> debbugs.gnu.org,  Mauro Aranda <maurooaranda <at> gmail.com>
> Date: Fri, 21 Jul 2023 11:13:13 +0300
> 
> It seems adding non-empty definitions in bug#64655
> were intended to workaround a bug in cus-edit.el,
> not to fix it.

I don't think it's a bug.  Why is it a bug to tell the user that the
face has no information to show as the current definition?

Moreover, what does it mean to have nil there in defface?  The
meaning of nil is not documented anywhere that I could see, so what
did the authors of such code expect it to produce?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 10:56:01 GMT) Full text and rfc822 format available.

Message #29 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, rpluim <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 13:56:15 +0300
> Cc: 64759 <at> debbugs.gnu.org
> From: Juri Linkov <juri <at> linkov.net>
> Date: Fri, 21 Jul 2023 11:13:52 +0300
> 
> Because it's used on the tab bar.

Then perhaps tab-bar.el should define its own face for that, and apply
it when displaying time there.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 16:23:02 GMT) Full text and rfc822 format available.

Message #32 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 19:20:44 +0300
>> It seems adding non-empty definitions in bug#64655
>> were intended to workaround a bug in cus-edit.el,
>> not to fix it.
>
> I don't think it's a bug.  Why is it a bug to tell the user that the
> face has no information to show as the current definition?

How this is different from a variable that has a nil value?
The Customization UI can handle it.

> Moreover, what does it mean to have nil there in defface?  The
> meaning of nil is not documented anywhere that I could see, so what
> did the authors of such code expect it to produce?

Why not nil?  Every variable supports a nil value.  Why can't faces
do the same?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 16:23:02 GMT) Full text and rfc822 format available.

Message #35 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 64759 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 19:21:40 +0300
> But it seems to me that it's better to define it like this:
> (defface foo '((t nil)) "...")
> so that the face gets a face-defface-spec property.
>
> So maybe the definition for display-time-date-and-time should be changed
> to:
> (defface display-time-date-and-time
>   '((t nil))
>   "Face for `display-time-format'."
>   :group 'mode-line-faces
>   :version "30.1")
>
> instead that making it inherit from mode-line?

Thanks, I confirm that '((t nil)) solves this problem.
If a nil value can't be supported for faces, then
let's use '((t nil)).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 16:40:01 GMT) Full text and rfc822 format available.

Message #38 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 19:39:33 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 64759 <at> debbugs.gnu.org,  maurooaranda <at> gmail.com
> Date: Fri, 21 Jul 2023 19:20:44 +0300
> 
> >> It seems adding non-empty definitions in bug#64655
> >> were intended to workaround a bug in cus-edit.el,
> >> not to fix it.
> >
> > I don't think it's a bug.  Why is it a bug to tell the user that the
> > face has no information to show as the current definition?
> 
> How this is different from a variable that has a nil value?
> The Customization UI can handle it.

It can and it does.  Emacs doesn't signal an error and doesn't crash.
So there's no problem, just unexpected info.

> > Moreover, what does it mean to have nil there in defface?  The
> > meaning of nil is not documented anywhere that I could see, so what
> > did the authors of such code expect it to produce?
> 
> Why not nil?  Every variable supports a nil value.  Why can't faces
> do the same?

I don't know, but the documentation says nothing about the semantics
of that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 16:41:01 GMT) Full text and rfc822 format available.

Message #41 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 19:40:36 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 64759 <at> debbugs.gnu.org,  Eli Zaretskii <eliz <at> gnu.org>
> Date: Fri, 21 Jul 2023 19:21:40 +0300
> 
> Thanks, I confirm that '((t nil)) solves this problem.
> If a nil value can't be supported for faces, then
> let's use '((t nil)).

What do you expect this to produce for the face attributes?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 17:54:02 GMT) Full text and rfc822 format available.

Message #44 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 20:51:57 +0300
>> Thanks, I confirm that '((t nil)) solves this problem.
>> If a nil value can't be supported for faces, then
>> let's use '((t nil)).
>
> What do you expect this to produce for the face attributes?

Let's see: when the definition is

  (defface display-time-date-and-time
    nil
    "Face for `display-time-format'."
    :group 'mode-line-faces
    :version "30.1")

then the customization buffer is

  Hide display-time-date-and-time face: [sample]
      State : NO CUSTOMIZATION DATA; not intended to be customized.
     Face for ‘display-time-format’.
     -- Empty face --
     Show All Attributes

But when the definition is

  (defface display-time-date-and-time
    '((t nil))
    "Face for `display-time-format'."
    :group 'mode-line-faces
    :version "30.1")

the customization buffer is

  Hide display-time-date-and-time face: [sample]
      State : STANDARD.
     Face for ‘display-time-format’.
     -- Empty face --
     Show All Attributes

Looks nice.  No strange error message about not intended to be customized.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 18:35:02 GMT) Full text and rfc822 format available.

Message #47 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 21:35:08 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: maurooaranda <at> gmail.com,  64759 <at> debbugs.gnu.org
> Date: Fri, 21 Jul 2023 20:51:57 +0300
> 
> >> Thanks, I confirm that '((t nil)) solves this problem.
> >> If a nil value can't be supported for faces, then
> >> let's use '((t nil)).
> >
> > What do you expect this to produce for the face attributes?
> 
> Let's see: when the definition is
> 
>   (defface display-time-date-and-time
>     nil
>     "Face for `display-time-format'."
>     :group 'mode-line-faces
>     :version "30.1")
> 
> then the customization buffer is
> 
>   Hide display-time-date-and-time face: [sample]
>       State : NO CUSTOMIZATION DATA; not intended to be customized.
>      Face for ‘display-time-format’.
>      -- Empty face --
>      Show All Attributes
> 
> But when the definition is
> 
>   (defface display-time-date-and-time
>     '((t nil))
>     "Face for `display-time-format'."
>     :group 'mode-line-faces
>     :version "30.1")
> 
> the customization buffer is
> 
>   Hide display-time-date-and-time face: [sample]
>       State : STANDARD.
>      Face for ‘display-time-format’.
>      -- Empty face --
>      Show All Attributes
> 
> Looks nice.  No strange error message about not intended to be customized.

That's not what I asked.  I asked about the face attributes.

IOW, isn't

  (defface display-time-date-and-time
    '((t nil))
    "Face for `display-time-format'."
    :group 'mode-line-faces
    :version "30.1")

the same as

  (defface display-time-date-and-time
    '((t (:inherit default)))
    "Face for `display-time-format'."
    :group 'mode-line-faces
    :version "30.1")

?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 18:51:01 GMT) Full text and rfc822 format available.

Message #50 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 21:49:13 +0300
>> Let's see: when the definition is
>>
>>   (defface display-time-date-and-time
>>     nil
>>     "Face for `display-time-format'."
>>     :group 'mode-line-faces
>>     :version "30.1")
>>
>> then the customization buffer is
>>
>>   Hide display-time-date-and-time face: [sample]
>>       State : NO CUSTOMIZATION DATA; not intended to be customized.
>>      Face for ‘display-time-format’.
>>      -- Empty face --
>>      Show All Attributes
>>
>> But when the definition is
>>
>>   (defface display-time-date-and-time
>>     '((t nil))
>>     "Face for `display-time-format'."
>>     :group 'mode-line-faces
>>     :version "30.1")
>>
>> the customization buffer is
>>
>>   Hide display-time-date-and-time face: [sample]
>>       State : STANDARD.
>>      Face for ‘display-time-format’.
>>      -- Empty face --
>>      Show All Attributes
>>
>> Looks nice.  No strange error message about not intended to be customized.
>
> That's not what I asked.  I asked about the face attributes.
>
> IOW, isn't
>
>   (defface display-time-date-and-time
>     '((t nil))
>     "Face for `display-time-format'."
>     :group 'mode-line-faces
>     :version "30.1")
>
> the same as
>
>   (defface display-time-date-and-time
>     '((t (:inherit default)))
>     "Face for `display-time-format'."
>     :group 'mode-line-faces
>     :version "30.1")
>
> ?

No, it's not the same.  The latter uses a white background on the mode line.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 21 Jul 2023 18:55:02 GMT) Full text and rfc822 format available.

Message #53 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 21 Jul 2023 21:55:20 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: maurooaranda <at> gmail.com,  64759 <at> debbugs.gnu.org
> Date: Fri, 21 Jul 2023 21:49:13 +0300
> 
> No, it's not the same.  The latter uses a white background on the mode line.

So I ask again: what is the semantics of nil in this case?  We cannot
have in Emacs something that triggers undefined behavior, let alone
use it in our own sources.  The semantics of this must be known and
documented before we can use it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Mon, 24 Jul 2023 17:38:02 GMT) Full text and rfc822 format available.

Message #56 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Mon, 24 Jul 2023 20:35:17 +0300
>> No, it's not the same.  The latter uses a white background on the mode line.
>
> So I ask again: what is the semantics of nil in this case?  We cannot
> have in Emacs something that triggers undefined behavior, let alone
> use it in our own sources.  The semantics of this must be known and
> documented before we can use it.

The semantics of nil could be the same as '((t nil)).

Do you agree that currently the value '((t nil))
should be used for faces without default face attributes?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Mon, 24 Jul 2023 18:21:01 GMT) Full text and rfc822 format available.

Message #59 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Mon, 24 Jul 2023 21:21:08 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: maurooaranda <at> gmail.com,  64759 <at> debbugs.gnu.org
> Date: Mon, 24 Jul 2023 20:35:17 +0300
> 
> >> No, it's not the same.  The latter uses a white background on the mode line.
> >
> > So I ask again: what is the semantics of nil in this case?  We cannot
> > have in Emacs something that triggers undefined behavior, let alone
> > use it in our own sources.  The semantics of this must be known and
> > documented before we can use it.
> 
> The semantics of nil could be the same as '((t nil)).

And what is the semantics of '((t nil)) ?  What attributes will the
face have when realized?

> Do you agree that currently the value '((t nil))
> should be used for faces without default face attributes?

Yes, I think so.  If no better face to inherit from is available in
each such case, that is.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Tue, 25 Jul 2023 17:06:01 GMT) Full text and rfc822 format available.

Message #62 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Tue, 25 Jul 2023 20:04:16 +0300
>> The semantics of nil could be the same as '((t nil)).
>
> And what is the semantics of '((t nil)) ?  What attributes will the
> face have when realized?

No attributes.  This is the standard value used by empty faces.

>> Do you agree that currently the value '((t nil))
>> should be used for faces without default face attributes?
>
> Yes, I think so.  If no better face to inherit from is available in
> each such case, that is.

This means these faces should have by default '((t nil)):
semantic-decoration-on-includes, shr-h4, shr-h5, shr-h6,
nxml-text, nxml-delimiter, nxml-element-colon, makefile-shell
as before?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Tue, 25 Jul 2023 17:44:02 GMT) Full text and rfc822 format available.

Message #65 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Tue, 25 Jul 2023 20:43:51 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: maurooaranda <at> gmail.com,  64759 <at> debbugs.gnu.org
> Date: Tue, 25 Jul 2023 20:04:16 +0300
> 
> >> The semantics of nil could be the same as '((t nil)).
> >
> > And what is the semantics of '((t nil)) ?  What attributes will the
> > face have when realized?
> 
> No attributes.  This is the standard value used by empty faces.

What does this mean?  For example, what would be the foreground color?
what would be the font? etc.

I'm not familiar with "empty face" notion.  A face always has
attributes when it is fully realized, otherwise Emacs will be unable
to use it.

> >> Do you agree that currently the value '((t nil))
> >> should be used for faces without default face attributes?
> >
> > Yes, I think so.  If no better face to inherit from is available in
> > each such case, that is.
> 
> This means these faces should have by default '((t nil)):
> semantic-decoration-on-includes, shr-h4, shr-h5, shr-h6,
> nxml-text, nxml-delimiter, nxml-element-colon, makefile-shell
> as before?

Only if "no better face to inherit from is available" in all of those
cases.  Which I'm not sure is true.  If you are sure, please tell why
the faces I put there are not better ideas.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 28 Jul 2023 17:39:02 GMT) Full text and rfc822 format available.

Message #68 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 28 Jul 2023 20:30:44 +0300
>> >> The semantics of nil could be the same as '((t nil)).
>> >
>> > And what is the semantics of '((t nil)) ?  What attributes will the
>> > face have when realized?
>>
>> No attributes.  This is the standard value used by empty faces.
>
> What does this mean?  For example, what would be the foreground color?
> what would be the font? etc.

No foreground color, and no font.

> I'm not familiar with "empty face" notion.  A face always has
> attributes when it is fully realized, otherwise Emacs will be unable
> to use it.

"Empty face" is the standard notion.  Here's an example how it's used:

1. M-x make-empty-face RET foo RET
2. M-x customize-face RET foo RET

Then output is:

  Hide Foo face: [sample]
      State : NO CUSTOMIZATION DATA; not intended to be customized.
     nil
     -- Empty face --

>> >> Do you agree that currently the value '((t nil))
>> >> should be used for faces without default face attributes?
>> >
>> > Yes, I think so.  If no better face to inherit from is available in
>> > each such case, that is.
>>
>> This means these faces should have by default '((t nil)):
>> semantic-decoration-on-includes, shr-h4, shr-h5, shr-h6,
>> nxml-text, nxml-delimiter, nxml-element-colon, makefile-shell
>> as before?
>
> Only if "no better face to inherit from is available" in all of those
> cases.  Which I'm not sure is true.  If you are sure, please tell why
> the faces I put there are not better ideas.

Because they will cause the same problem as with display-time-date-and-time,
except that other faces are used less often, so it will take time until users
will notice these problems.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Fri, 28 Jul 2023 18:50:02 GMT) Full text and rfc822 format available.

Message #71 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Fri, 28 Jul 2023 21:49:49 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: maurooaranda <at> gmail.com,  64759 <at> debbugs.gnu.org
> Date: Fri, 28 Jul 2023 20:30:44 +0300
> 
> >> >> The semantics of nil could be the same as '((t nil)).
> >> >
> >> > And what is the semantics of '((t nil)) ?  What attributes will the
> >> > face have when realized?
> >>
> >> No attributes.  This is the standard value used by empty faces.
> >
> > What does this mean?  For example, what would be the foreground color?
> > what would be the font? etc.
> 
> No foreground color, and no font.

There can be no such face.

> > I'm not familiar with "empty face" notion.  A face always has
> > attributes when it is fully realized, otherwise Emacs will be unable
> > to use it.
> 
> "Empty face" is the standard notion.  Here's an example how it's used:
> 
> 1. M-x make-empty-face RET foo RET
> 2. M-x customize-face RET foo RET
> 
> Then output is:
> 
>   Hide Foo face: [sample]
>       State : NO CUSTOMIZATION DATA; not intended to be customized.
>      nil
>      -- Empty face --

We are mis-communicating.  My point is that we need to explain in the
documentation the effect of such a defface when the face is realized
and displayed.  Lisp programmers need to understand that to be able to
use this correctly and predictably.

> > Only if "no better face to inherit from is available" in all of those
> > cases.  Which I'm not sure is true.  If you are sure, please tell why
> > the faces I put there are not better ideas.
> 
> Because they will cause the same problem as with display-time-date-and-time,
> except that other faces are used less often, so it will take time until users
> will notice these problems.

display-time-date-and-time is used on the mode line, where the colors
are different.  The other faces are for buffer text, so the problems
with display-time-date-and-time don't necessarily apply.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Mon, 31 Jul 2023 17:46:01 GMT) Full text and rfc822 format available.

Message #74 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Mon, 31 Jul 2023 20:42:22 +0300
>> 1. M-x make-empty-face RET foo RET
>> 2. M-x customize-face RET foo RET
>> 
>> Then output is:
>> 
>>   Hide Foo face: [sample]
>>       State : NO CUSTOMIZATION DATA; not intended to be customized.

Please note that the problem is still unfixed for
"NO CUSTOMIZATION DATA".

>>      nil
>>      -- Empty face --
>
> We are mis-communicating.  My point is that we need to explain in the
> documentation the effect of such a defface when the face is realized
> and displayed.  Lisp programmers need to understand that to be able to
> use this correctly and predictably.

For example, in *scratch* eval:

  (put-text-property (point-min) (point-max)
                     'font-lock-face (make-empty-face 'foo))

Then 'C-u C-x =' shows:

  There are text properties here:
    font-lock-face       foo

Then clicking on 'foo' shows:

  Face: foo (sample) (customize this face)
  Documentation:
  Not documented as a face.
             Family: unspecified
            Foundry: unspecified
              Width: unspecified
             Height: unspecified
             Weight: unspecified
              Slant: unspecified
         Foreground: unspecified
  DistantForeground: unspecified
         Background: unspecified
          Underline: unspecified
           Overline: unspecified
     Strike-through: unspecified
                Box: unspecified
            Inverse: unspecified
            Stipple: unspecified
               Font: unspecified
            Fontset: unspecified
             Extend: unspecified
            Inherit: unspecified

That's all that Lisp programmers need to know: that in an empty face
all attributes are unspecified.

>> > Only if "no better face to inherit from is available" in all of those
>> > cases.  Which I'm not sure is true.  If you are sure, please tell why
>> > the faces I put there are not better ideas.
>> 
>> Because they will cause the same problem as with display-time-date-and-time,
>> except that other faces are used less often, so it will take time until users
>> will notice these problems.
>
> display-time-date-and-time is used on the mode line, where the colors
> are different.  The other faces are for buffer text, so the problems
> with display-time-date-and-time don't necessarily apply.

It's possible that these faces are applied over other faces
that will break the default theme.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Mon, 31 Jul 2023 18:33:01 GMT) Full text and rfc822 format available.

Message #77 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#64759: Broken faces
Date: Mon, 31 Jul 2023 21:31:54 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: maurooaranda <at> gmail.com,  64759 <at> debbugs.gnu.org
> Date: Mon, 31 Jul 2023 20:42:22 +0300
> 
> Then clicking on 'foo' shows:
> 
>   Face: foo (sample) (customize this face)
>   Documentation:
>   Not documented as a face.
>              Family: unspecified
>             Foundry: unspecified
>               Width: unspecified
>              Height: unspecified
>              Weight: unspecified
>               Slant: unspecified
>          Foreground: unspecified
>   DistantForeground: unspecified
>          Background: unspecified
>           Underline: unspecified
>            Overline: unspecified
>      Strike-through: unspecified
>                 Box: unspecified
>             Inverse: unspecified
>             Stipple: unspecified
>                Font: unspecified
>             Fontset: unspecified
>              Extend: unspecified
>             Inherit: unspecified
> 
> That's all that Lisp programmers need to know: that in an empty face
> all attributes are unspecified.

See, I don't think this is accurate.  I think the result depends on
the default attributes, the ones you can change by using
set-face-attribute with FRAME set to t.

> >> > Only if "no better face to inherit from is available" in all of those
> >> > cases.  Which I'm not sure is true.  If you are sure, please tell why
> >> > the faces I put there are not better ideas.
> >> 
> >> Because they will cause the same problem as with display-time-date-and-time,
> >> except that other faces are used less often, so it will take time until users
> >> will notice these problems.
> >
> > display-time-date-and-time is used on the mode line, where the colors
> > are different.  The other faces are for buffer text, so the problems
> > with display-time-date-and-time don't necessarily apply.
> 
> It's possible that these faces are applied over other faces
> that will break the default theme.

Such use of these faces only makes sense if the face is customized to
have some attributes different from the defaults.  The intention of
the default definition of these faces is to make them look no
different from the default face.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64759; Package emacs. (Mon, 31 Jul 2023 20:39:01 GMT) Full text and rfc822 format available.

Message #80 received at 64759 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 64759 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#64759: Broken faces
Date: Mon, 31 Jul 2023 17:37:55 -0300
Juri Linkov <juri <at> linkov.net> writes:

>>> 1. M-x make-empty-face RET foo RET
>>> 2. M-x customize-face RET foo RET
>>>
>>> Then output is:
>>>
>>>   Hide Foo face: [sample]
>>>       State : NO CUSTOMIZATION DATA; not intended to be customized.
>
> Please note that the problem is still unfixed for
> "NO CUSTOMIZATION DATA".
>

I don't think this is a problem.  defface wasn't used here, so the face
might not be intended to be customized.




This bug report was last modified 1 year and 321 days ago.

Previous Next


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