* bug#74104: 31.0.50; 'custom-set-faces' overrides face when no theme is loaded
@ 2024-10-30 10:14 Protesilaos Stavrou
2024-10-30 15:39 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Protesilaos Stavrou @ 2024-10-30 10:14 UTC (permalink / raw)
To: 74104
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#74104: 31.0.50; 'custom-set-faces' overrides face when no theme is loaded
2024-10-30 10:14 bug#74104: 31.0.50; 'custom-set-faces' overrides face when no theme is loaded Protesilaos Stavrou
@ 2024-10-30 15:39 ` Eli Zaretskii
2024-10-31 5:35 ` Protesilaos Stavrou
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-10-30 15:39 UTC (permalink / raw)
To: Protesilaos Stavrou; +Cc: 74104
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#74104: 31.0.50; 'custom-set-faces' overrides face when no theme is loaded
2024-10-30 15:39 ` Eli Zaretskii
@ 2024-10-31 5:35 ` Protesilaos Stavrou
0 siblings, 0 replies; 3+ messages in thread
From: Protesilaos Stavrou @ 2024-10-31 5:35 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 74104
> 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?
--
Protesilaos Stavrou
https://protesilaos.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-31 5:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30 10:14 bug#74104: 31.0.50; 'custom-set-faces' overrides face when no theme is loaded Protesilaos Stavrou
2024-10-30 15:39 ` Eli Zaretskii
2024-10-31 5:35 ` Protesilaos Stavrou
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).