Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs 24: Unable to find theme file for `solarized-dark.

I am on Mac 10.9.5 using Emacs 24.4

Following the instruction in here: https://github.com/sellout/emacs-color-theme-solarized , I downloaded the emacs-color-theme-solarized directory and added it to my Emacs custom-theme-load-path. That directory (Emacs was installed with 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) to my .emacs file and when I re-initiate emacs I get the error: Unable to find theme file for 'solarized-dark .

I have tried to move all file within the emacs-color-theme-solarized directory directly into the /opt/local/share/emacs/24.4/etc/themes/ directory, 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 obtained the same result. Finally, I read here: Emacs 24 Package System Initialization Problems that a possible solution is adding the following two lines at the beginning of my .emacs file:

(setq package-enable-at-startup nil)
(package-initialize)

So I did and obtained the same result. Even loading the theme manually: load-theme and then solarized-dark is not solving the issue. It seems like any changes done to that directory are ignored by .emacs.

By the way, I also tried to add (add-to-list 'load-path " /opt/local/share/emacs/24.4/etc/themes") to my .emacs file as well as (add-to-list 'load-path " ~/emacs.d/themes"), and it was, also, unsuccessful.

In case is of any use, any of the themes that come with the instalation, e.g (load-theme 'tsdh-dark t), work perfectly

Any ideas of how to solve this issue for the solarized theme?

thanks and happy new year!

like image 479
Javier Avatar asked Dec 31 '14 12:12

Javier


1 Answers

Emacs 24 includes package.el, and I strongly recommend using that to install packages whenever possible. Versions of the Solarized theme are available from MELPA Stable, MELPA, and Marmalade.

If you haven't used any of these package repositories yet, you'll need to add one by putting something like this in 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, search for color-theme-sanityinc-solarized, mark it for installation with i and then install marked packages with x. I find this package list interface very handy for discovering new packages.

Packages installed this way generally go into ~/.emacs.d/elpa/, e.g. ~/.emacs.d/elpa/color-theme-solarized-2.27/. This should automatically be added to your custom-theme-load-path, which is required for load-theme to work.

Note that this particular version includes two themes prefixed with the package maintainer's name, so you'll have to do something like

(load-theme 'sanityinc-solarized-dark)  ; or
(load-theme 'sanityinc-solarized-light)

to make the theme load. Interactively, load-theme supports tab completion, which is probably the best way to see what installed themes are actually called.

As an aside, you might also want to look into tools for automating the package.el install process, which is especially handy if you work on multiple machines.

like image 158
Chris Avatar answered Nov 14 '22 18:11

Chris