emacs-devel
[Top][All Lists]
Advanced

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

Re: Why is custom--inhibit-theme-enable not t by default?


From: Andy Moreton
Subject: Re: Why is custom--inhibit-theme-enable not t by default?
Date: Mon, 18 Jun 2018 15:07:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

On Sun 17 Jun 2018, Andy Moreton wrote:

> On Tue 12 Jun 2018, address@hidden wrote:
>
>>>> Date: Mon, 11 Jun 2018 21:14:49 -0700
>>>> From: address@hidden
>>>>
>>>> A simple require of a package shouldn't have side effects, especially
>>>> not
>>>> ones as drastic as changing the entire appearance of the program.
>>>
>>> I think themes are special in this regard: loading a theme activates
>>> it.
>>>
>>
>> Why did we do it that way? Is it too late to change it? Loading _anything_
>> shouldn't activate it. I don't see a need to carve out a special case for
>> themes.
>>
>> At the very least, we should make custom--inhibit-theme-enable a public
>> variable so people can let-binding something that lets them load theme
>> code normally without the expectation of serious side effects.
>
> The changes you made in commit aabaa9f8c8b7 ("Apply non-user themes only
> when asked") break use of custom faces with use-package. E.g. in gnus:
>
>     (use-package gnus
>       :custom-face
>       (gnus-summary-selected
>        ((((class color)) :foreground "Black" :background "PaleGoldenrod")))
>       :config
>       ;; other setup
>       )
>
> The observed symptom is that the faces are not set correctly as specified
> after the :custom-face keyword. However if the same buffer is viewed in
> a new frame then it is displayed with the correct customised faces.
>
> This is a regression introduced by this commit - please take a look.

It appears that the change in cus-face.el in commit aabaa9f8c8b7 did not
match the other hunks and invert the test when changing from
`custom--inhibit-theme-enable' to `custom--should-apply-setting'.

The following patch fixes it:

diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 039c1fafa7..54f5d51358 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -342,7 +342,7 @@ custom-theme-set-faces
        ;; is aliased to.
        (if (get face 'face-alias)
            (setq face (get face 'face-alias)))
-   (if (custom--should-apply-setting theme)
+ (if (not (custom--should-apply-setting theme))
            ;; Just update theme settings.
            (custom-push-theme 'theme-face face theme 'set spec)
          ;; Update theme settings and set the face spec.




reply via email to

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