Emacs 24: Unable to find theme file for "solarized-dark".
I'm on Mac 10.9.5 using Emacs 24.4
Following the instructions here: https://github.com/sellout/emacs-color-theme-solarized , I downloaded the directory emacs-color-theme-solarized
and added it to my custom Emacs theme - loads path. This directory ( Emacs
was installed since Macports
) looks like this:
ls /opt/local/share/emacs/24.4/etc/themes/
adwaita-theme.el light-blue-theme.el tsdh-dark-theme.el
deeper-blue-theme.el manoj-dark-theme.el tsdh-light-theme.el
dichromacy-theme.el misterioso-theme.el wheatgrass-theme.el
emacs-color-theme-solarized tango-dark-theme.el whiteboard-theme.el
leuven-theme.el tango-theme.el wombat-theme.el
where emacs-color-theme-solarized
is the directory. Then I added (load-theme 'solarized-dark t)
in my file .emacs
, and when I started again Emacs
, I got an error: Unable to find theme file for 'solarized-dark
.
I tried to move the whole file in the directory emacs-color-theme-solarized
directly to the directory /opt/local/share/emacs/24.4/etc/themes/
so that:
ls /opt/local/share/emacs/24.4/etc/themes/
LICENSE leuven-theme.el tango-dark-theme.el
README.md light-blue-theme.el tango-theme.el
adwaita-theme.el makepkg.sh tsdh-dark-theme.el
color-theme-solarized-pkg.el manoj-dark-theme.el tsdh-light-theme.el
color-theme-solarized.el misterioso-theme.el wheatgrass-theme.el
deeper-blue-theme.el solarized-dark-theme.el whiteboard-theme.el
dichromacy-theme.el solarized-definitions.el wombat-theme.el
emacs-color-theme-solarized solarized-light-theme.el
follow the same process and get the same result. Finally, I read here: Emacs 24 Problems initializing the package system , that a possible solution adds the following two lines to the beginning of my file .emacs
:
(setq package-enable-at-startup nil)
(package-initialize)
So I did and got the same result. Even loading the theme manually: load-theme
and then solarized-dark
doesn't solve the problem. It seems that any changes made to this directory are ignored .emacs
.
BTW, I also tried adding (add-to-list 'load-path " /opt/local/share/emacs/24.4/etc/themes")
to my .emacs
file as well (add-to-list 'load-path " ~/emacs.d/themes")
and it was unsuccessful too.
For any use, any of the themes that come with the installation, for example (load-theme 'tsdh-dark t)
, works great
Any ideas on how to solve this for a solarized theme?
thanks and happy new year!
source to share
Emacs 24 includes package.el
, and I highly recommend using that to install packages whenever possible. Solarized versions are available from MELPA Stable , MELPA and Marmalade .
If you haven't used any of these package repositories yet, you need to add them by adding something like this to your init file:
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
Then use M-x package-list-packages
, find color-theme-sanityinc-solarized
, mark it for installation with i
, and then install the marked packages with x
. I found this package listing interface very handy for discovering new packages.
Packages installed this way are usually included in ~/.emacs.d/elpa/
eg. ~/.emacs.d/elpa/color-theme-solarized-2.27/
... This should be automatically added to yours custom-theme-load-path
, which is required to work load-theme
.
Note that this particular version includes two topics prefixed with the package maintainer name, so you would need to do something like
(load-theme 'sanityinc-solarized-dark) ; or
(load-theme 'sanityinc-solarized-light)
to make the theme load. load-theme
Supports tab completion interactively , which is probably the best way to see which actually installed themes are being called.
As an aside, you can also look into the tools to automate the installation processpackage.el
, which is especially handy if you work on multiple machines.
source to share