I want to understand why an expression of the form
(load-theme 'my-kewl-theme t)
fails1 when run as the last expression in my init (~/.emacs
) file, but works fine if I evaluate it as soon as soon as Emacs' startup is done.
How can I troubleshoot/debug this conundrum?
The only clue I have is that right before (load-theme 'my-kewl-theme t)
is evaluated at the end of the loading of ~/.emacs
, the variable custom-theme-load-path
has the value
(custom-theme-load-directory t)
whereas after Emacs starts, it has the value
("/path/to/my-kewl-theme/" custom-theme-load-directory t)
I don't know what accounts for this difference. (This variable is not referred to at all by ~/.emacs
, at least explicitly.) The variable custom-theme-load-directory
has the value ~/.emacs.d
throughout.
1error: Unable to find theme file for `my-kewl-theme`
"/path/to/my-kewl-theme/"
as its first element, in your init file before invoking theload-theme
. You can alternatively try to find the code that (already) adds that path to the value, and evaluate that code before loading the theme.