Subject: Re: bug#68880: 30.0.50; [pgtk] Theme customization is not applied by custom-theme-set-faces until theme is re-enabled

From: Mauro Aranda <[email-masked]>
Date: Sat, 8 Mar 2025 06:54:31 -0300

Dmitry Gutov <[email-masked]> writes:

 > To reproduce, put this into .emacs:
 >
 > (add-hook
 >   'after-init-hook
 >   (lambda ()
 >     (load-theme 'adwaita t)
 >
 >     (custom-theme-set-faces
 >      'adwaita
 >      '(font-lock-comment-face ((t (:foreground "yellow")))))))
 >
 > Then run emacs -Q.
 >
 > When the PGTK port is used, the comment face's foreground won't be
 > yellow. With other ports (e.g. GTK3 or Lucid), it is.

I can't reproduce it.  As expected, with emacs -Q, the lambda function
never gets called.

So, I see the same on the 3 builds I've tried (GTK3, Lucid,
PGTK): Emacs starts with the default theme.

 > The use of after-init-hook itself it not crucial - you can just as well
 > enable the theme using 'M-x load-theme' and then evaluate the
 > custom-theme-set-faces form.

If I start with emacs -Q and then evaluate the forms inside the
lambda function, I can't reproduce it either, because I see the exact
same thing on the 3 builds: adwaita theme gets loaded and enabled, but
the font-lock-comment-face customization doesn't get customized to
yellow.

IOW, I can reproduce, but it's not pgtk specific.

I think this is related to Bug#76685.  But since I can't reproduce the
bug exactly as reported, I would like to check before merging the bugs.