unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2024-10-30 15:39 UTC | newest]

Thread overview: 2+ 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

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).