bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54156: 28.0.91; set-face-attribute with a nil FRAME doesn't change t


From: Eli Zaretskii
Subject: bug#54156: 28.0.91; set-face-attribute with a nil FRAME doesn't change the default
Date: Fri, 25 Feb 2022 15:24:39 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: damien@cassou.me,  54156@debbugs.gnu.org
> Date: Fri, 25 Feb 2022 14:12:17 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > But that's not what nil does in this case.  It means the same as
> > 'unspecified': that you have nothing to say about that particular
> > attribute.  So Emacs does nothing.
> 
> But like I said -- Emacs does do something, but only on existing frames.

Right; sorry for not being accurate.

But let me explain a bit more.

The default attributes for faces that are used when creating new
frames are stored in face--new-frame-defaults.  When a frame is
created, those attributes are merged with what the face's spec (from
defface) says.  Thus, having 'unspecified' in face--new-frame-defaults
for an attribute has no effect: the definition of the attribute in
defface will override it.

So we need a special trick to override defface with 'unspecified', and
that trick is this call:

  (set-face-attribute 'region t :background 'unspecified)

This is handled specially in internal-set-lisp-face-attribute to do
what Damien wants.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]