Emacs 24 themes and inherit attribute

I am using zenburn from here:

https://github.com/djcb/elisp/blob/master/themes/zenburn-theme.el

It uses many settings :inherit . However, I notice that when I switch to another x theme and then back, the foreground x will remain with zenburn :inherit .

What to do?

+4
source share
2 answers

: Inheritance works weirdly in Emacs 24 ... it is unclear whether the current behavior is a β€œfeature” or an error. I usually download themes:

 (load-theme 'zenburn t) (load "zenburn-theme") 

at the end of my init.el; explicit load must have reset inheritance. This is the advice of the author of this topic , and it is great for me and for other topics (for example, for solarization).

+2
source

This is simply because Emacs custom themes are cumulative by default. To replace one topic with another, it is not enough to include a second. You must first disable the one you need to replace. Otherwise, the effect is to combine the two.

Most likely, the download sequence described by @ChristopherMonsanto has the effect of disabling the current theme and then enabling the zenburn theme.

FWIW, color themes (from the color-theme.el ) work differently than Emacs custom themes - color themes do not have this problem / function. For more details see http://www.emacswiki.org/emacs/ColorTheme .

0
source

All Articles