I have some custom theme settings like

(load-theme 'leuven t)
   '(Man-overstrike ((t (:foreground "red3" :bold t))) t)
   '(Man-underline ((t (:foreground "green3" :underline t))))
   ;; ... ignored
   '(yas-field-highlight-face ((t (:background "#D4DCD8" :foreground "black" :box (:line-width -1 :color "#838383"))))))

in my init.el of a emacs -q session. It works perfectly in emacs 26.1, but not in emacs 27, that's no matter how many times I evaluate the code, there's no custom face changes. I searched google but I can't find if there's some API changes in emacs 27.

Work Eamcs Version: GNU Emacs 26.1.92 (build 2, x86_64-apple-darwin18.2.0, Carbon Version 158 AppKit 1671.2) of 2019-02-26

Unwork Emacs version: GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-03-10

Any help will be appreciated.

  • 2
    Please update your to describe how it’s not working – nega Mar 15 '19 at 14:42
  • There is no Emacs 27 - it has not yet been released. Please use emacs-version to obtain and note in your question what Emacs-27 development snapshot/build you see the problem in. – Drew Mar 15 '19 at 18:01
  • The question is unclear, and so risks being deleted. Please specify just what you mean by it not working. Provide a step-by-step recipe, saying what you do at each step, what you see as the effect, and what you expected to see instead. And please start Emacs using emacs -Q (no init file) for the recipe. Thx. – Drew Mar 15 '19 at 18:03
  • You might want to submit an Emacs bug report, since you are using a development build: M-x report-emacs-bug. Or you might want to just try a more recent build. The development stream is a work in progress. – Drew Mar 16 '19 at 1:08

Put this line in your init. Theme changes will take effect immediately in Emacs 27.

(setq custom--inhibit-theme-enable nil)

Presumably the automatic theme changing was disabled for a good reason. I haven't looked into the reason, but to set the value temporarily for just 1 statement you could do this.

(let ((custom--inhibit-theme-enable nil))
  ;; theme settings

The double dashes -- in the name mean it is a "private" variable. So it is subject to change at any time and may not work forever.

I haven't looked into it too deeply. And there are a few other ways to make the color take effect immediately. But setting this variable to nil is the most straight forward way to get the old behavior back.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.