--- Begin Message ---
Subject: |
31.0.50; 'custom-set-faces' overrides face when no theme is loaded |
Date: |
Wed, 30 Oct 2024 12:14:40 +0200 |
Dear maintainers,
When a theme is already enabled, 'custom-set-faces' has the effect of
adding face attributes on top of the existing ones. Those that were
present are not removed: they are blended with the new ones.
This, however, is not happening when no theme is loaded. In that
scenario, 'custom-set-faces' removes all the underlying face attributes
and keeps only those specified in the function call. I think this is a
mistake.
Steps to reproduce:
- Start Emacs in 'emacs -Q'.
- Note that the mode line has a background colour that is distinct from
that of the buffer.
- In the scratch buffer, evaluate:
(custom-set-faces
'(mode-line ((t :box nil))))
- Note that the above did not only remove the :box attribute. It also
removed the :background value that was there. The mode line is now the
same colour as the scratch buffer.
- Now try to undo the effect:
(custom-set-faces
'(mode-line (( ))))
- Neither the original background nor the box style is not restored.
My expected behaviour is for 'custom-set-faces' to (i) preserve the
underlying face attributes, (ii) only override those that are specified,
and (iii) revert to the underlying face when it is called with a nil
value.
All the best,
Protesilaos (or simply "Prot")
* * *
In GNU Emacs 31.0.50 (build 9, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.16.0) of 2024-10-27 built on kronos
Repository revision: aaefb67f54513e8375ec8356d09bf2e6f25b9116
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)
Configured using:
'configure --prefix=/usr/local --with-x-toolkit=gtk3
--disable-gc-mark-trace --with-native-compilation=aot --without-gif
--without-tiff --without-selinux --without-xinput2 --without-gpm
--without-compress-install --without-xft --with-cairo --with-harfbuzz
--with-tree-sitter=ifavailable --without-gsettings --without-gconf'
Configured features:
ACL CAIRO DBUS FREETYPE GLIB GMP GNUTLS HARFBUZZ JPEG LCMS2 LIBOTF
LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PNG RSVG SECCOMP SOUND THREADS TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM
GTK3 ZLIB
--
Protesilaos Stavrou
https://protesilaos.com
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#74104: 31.0.50; 'custom-set-faces' overrides face when no theme is loaded |
Date: |
Sat, 23 Nov 2024 14:13:39 +0200 |
> Cc: 74104@debbugs.gnu.org
> Date: Sat, 09 Nov 2024 12:04:50 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> > From: Protesilaos Stavrou <info@protesilaos.com>
> > Cc: 74104@debbugs.gnu.org
> > Date: Thu, 31 Oct 2024 07:35:34 +0200
> >
> > > From: Eli Zaretskii <eliz@gnu.org>
> > > Date: Wed, 30 Oct 2024 17:39:30 +0200
> > >
> > >> From: Protesilaos Stavrou <info@protesilaos.com>
> > >> Date: Wed, 30 Oct 2024 12:14:40 +0200
> > >>
> > >> Dear maintainers,
> > >>
> > >> When a theme is already enabled, 'custom-set-faces' has the effect of
> > >> adding face attributes on top of the existing ones. Those that were
> > >> present are not removed: they are blended with the new ones.
> > >>
> > >> This, however, is not happening when no theme is loaded. In that
> > >> scenario, 'custom-set-faces' removes all the underlying face attributes
> > >> and keeps only those specified in the function call. I think this is a
> > >> mistake.
> > >
> > > custom-set-faces is used to set up customized faces in the user's init
> > > files: they are the forms written by Custom when the user decides to
> > > save the face customizations for future sessions. So I don't think
> > > this is a mistake, and I don't see how we can change this without
> > > catastrophic effects on everyone's init files.
> >
> > Indeed, I do not want to break anybody's setup or even make far-reaching
> > changes just for this. Do you think the difference in behaviour when a
> > theme is loaded versus when it is not is the intended design?
>
> Yes, I think so.
No further comments, so I'm now closing this bug.
--- End Message ---