Emacs for Windows error loading color theme

I use emacs 24.3 on Windows 8. I installed the sunny color theme from the marmalade repository and can install it with M+ x load-theme. It also sets for the current session when I use Customize, but does not load when I open emacs again.

I can open the settings menu and select a theme, but saving changes does nothing, and nothing changes between this and my next session. I examined a few questions about color themes, but most of them are not related to Emacs 24, since you do not need to use this color-theme.

Below is a snippet from my file .emacs.

(custom-set-variables
  '(custom-enabled-themes (quote (solarized-dark)))
  '(custom-safe-themes (quote ("fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" default)))
...

When I try to put (load-theme 'solarized-dark t)in mine .emacs, I get an error:

error: Unable to find theme file for `solarized-dark'

I checked the value custom-theme-load-pathafter opening emacs and it includes a directory that elpa uses to store the solar theme. As mentioned above, I can download the theme manually, but something about loading it during init breaks.

+5
source share
2 answers

Just add

(initialization package)

The top of your .emacs file is good for you.

+14
source

Side note: if the author of a topic takes care of this, the topic will add itself to custom-theme-load-path, however, this is not a part defthemeand does not correspond to the individual authors of the topic implement this behavior.

, emacslisp, , custom-theme-load-path .

~/.emacs ~/.emacs.d/init.el (.. , load-theme

s.el dash.el ( elpa)

(require 'dash)
(require 's)

(-each
 (-map
  (lambda (item)
    (format "~/.emacs.d/elpa/%s" item))
  (-filter
   (lambda (item) (s-contains? "theme" item))
   (directory-files "~/.emacs.d/elpa/")))
 (lambda (item)
   (add-to-list 'custom-theme-load-path item)))
0

All Articles