質問

I'm trying to configure Aquamacs to use the solarized theme. I've already configured aquamacs to use erlang and that works fine. After trying to add the custom theme to the load path however, I get the following error when launching aquamacs:

Symbol's value as variable is void: custom-theme-load-path

I'm very new to emacs and I'm still jumping through hoops for almost everything and this has me stunned. I've doublechecked the path a zillion times so I'm probably just not understanding how to add the theme path properly.

This is my ~/.emacs-old.el file which aquamacs uses:

(setq load-path (cons"/usr/local/Cellar/erlang/R15B01/lib/erlang/lib/tools-2.6.7/emacs" load-path))
(setq erlang-root-dir "/usr/local/Cellar/erlang/R15B01/lib/erlang/lib")
(setq exec-path (cons "/usr/local/Cellar/erlang/R15B01/lib/erlang/bin" exec-path))
(require 'erlang-start)

(add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-color-theme-solarized/")
(load-theme 'solarized-[light|dark] t)

Here is a print out from my terminal with a file listing and path:

Daniel:emacs-color-theme-solarized daniel$ pwd
/Users/daniel/.emacs.d/emacs-color-theme-solarized
Daniel:emacs-color-theme-solarized daniel$ ls -l
total 208
-rw-r--r--  1 daniel  staff   1061 Mar  4 14:04 LICENSE
-rw-r--r--  1 daniel  staff   8744 Mar  4 14:04 README.md
drwxr-xr-x  7 daniel  staff    238 Mar  4 14:20 color-theme-solarized-20130304
-rw-r--r--  1 daniel  staff  36864 Mar  4 14:20 color-theme-solarized-20130304.tar
-rw-r--r--  1 daniel  staff    109 Mar  4 14:04 color-theme-solarized-pkg.el
-rw-r--r--  1 daniel  staff   1846 Mar  4 14:04 color-theme-solarized.el
-rwxr-xr-x  1 daniel  staff    309 Mar  4 14:04 makepkg.sh
-rw-r--r--  1 daniel  staff    169 Mar  4 14:04 solarized-dark-theme.el
-rw-r--r--  1 daniel  staff  28902 Mar  4 14:04 solarized-definitions.el
-rw-r--r--  1 daniel  staff    170 Mar  4 14:04 solarized-light-theme.el
Daniel:emacs-color-theme-solarized daniel$ 
役に立ちましたか?

解決

custom-theme-load-path was added in Emacs 24 (see the NEWS file). You must have Emacs 23 or older, which means you'll have to load the theme the old way.

If you don't have it already (try M-x color-theme-select if you're not sure), download and install color-theme.

Then, load the solarized theme with the full path:

(load-file "~/.emacs.d/emacs-color-theme-solarized/color-theme-solarized.el")

Once it's loaded, then you can either run M-x color-theme-solarized or load it directly from your .emacs file with

(color-theme-solarized)

他のヒント

You're missing custom-theme-load-path. And no, you cannot just “add” it. This variable is part of the new theming infrastructure in Emacs 24. However, you are apparently using Aquamacs which is Emacs 23.

To install Solarized in this version in Emacs, use emacs-color-theme-solarized and follow the installation instructions for pre Emacs 24.

But do yourself a favor, dismiss Aquamacs, and use plain GNU Emacs 24.2.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top