dimitri / el-get

Manage the external elisp bits and pieces upon which you depend!
http://tapoueh.org/emacs/el-get.html
1.65k stars 456 forks source link

Loading theme (zenburn) via el-get fails, requires M-x load-theme w prompts each emacs restart #2637

Open jfkw opened 6 years ago

jfkw commented 6 years ago

Sometime in the past few months my previously working configuration to load the zenburn color theme via el-get fails.

When the el-get method fails, I must load the zenburn theme via M-x load-theme, and accept the prompts on each restart of the emacs daemon.

Versions:

el-get version: 5.1.a063360
emacs version: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit) of 2018-07-31

The current zenburn recipe ends with the following code:

$ tail -n 2 el-get/recipes/color-theme-zenburn.rcp
       :prepare (autoload 'color-theme-zenburn "zenburn"
                  "color-theme: zenburn" t))

I load zenburn with el-get as follows (excerpt from larger setq with other packages):

(setq el-get-sources
      '((:name color-theme-zenburn)))

Load zenburn theme manually:

M-x load-theme
Load custom theme: zenburn
Loading a theme can run Lisp code.  Really load? (y or n) y
Treat this theme as safe in future sessions? (y or n) y

The manual M-x load-theme must be repeated each time emacs (daemon) is restarted.

Based on behaviour it seems the autoloads managed call to (load-theme 'zenburn t) may not be including the t parameter. I haven't yet traced through autoloads execution to confirm this.

Is there updated recommended el-get-sources initialization code for themes that works around this?

npostavs commented 6 years ago

I guess this entry in etc/NEWS is relevant:

* Incompatible Lisp Changes in Emacs 27.1

---
** Just loading a theme's file no longer activates the theme's settings.
Loading a theme with 'M-x load-theme' still activates the theme, as it
did before.  However, loading the theme's file with "M-x load-file",
or using 'require' or 'load' in a Lisp program, doesn't actually apply
the theme's settings until you either invoke 'M-x enable-theme' or
type 'M-x load-theme'.  (In a Lisp program, calling 'enable-theme' or
invoking 'load-theme' with NO-ENABLE argument omitted or nil has the
same effect of activating a theme whose file has been loaded.)  The
special case of the 'user' theme is an exception: it is frequently
used for ad-hoc customizations, so the settings of that theme are by
default applied immediately.

The variable 'custom--inhibit-theme-enable' controls this behavior;
its default value changed in Emacs 27.1.