4

I've been trying to install color themes for emacs and I'm not quite sure how I can do it. I have downloaded an .el file and put it under my .emacs.d folder, then edited my .emacs file and added this:

(add-to-list 'load-path "~/.emacs.d/empty-void.el")
(add-to-list 'load-path "~/.emacs.d/color-theme.el")
(require 'color-theme)
(load-theme 'empty-void)
(eval-after-load "color-theme"
  '(progn
    (color-theme-initialize)))

Then I opened emacs and tried to do M-x color-theme-empty-void but there isn't any command like that. So I did M-x color-theme-select but the theme was not listed there either.

I tried this with other theme files too but I couldn't get it to work. How can I load the theme files to color-theme?

3
  • In general, the .emacs.d root directory is not automatically included within the load-path. A path to an *.el file is not usually used in conjunction with load-path, but instead is normally used in conjunction with load-file -- without using add-to-list. So those are likely your first two problems right off the bat.
    – lawlist
    Oct 7, 2014 at 2:12
  • For example, you could use (load-file "~/.emacs.d/empty-void.el") (load-file "~/.emacs.d/color-theme.el") and then not even worry about the load-path. I've seen experienced Emacs users recommend setting up sub-directories in the .emacs.d folder, e.g., ~/.emacs.d/lisp -- and you can add that sub-directory to your load-path and put your *.el files inside it and then use something like (require '...) assuming of course that there is a (provide '....) statement at the bottom of each *.el file that you are seeking to require.
    – lawlist
    Oct 7, 2014 at 2:21
  • Using load-file did the trick for me, thanks a lot! Oct 7, 2014 at 12:24

1 Answer 1

4

Step 1:  Download the latest version of color-theme -- i.e., color-theme-6.6.0.zip from: http://download.savannah.gnu.org/releases/color-theme/

Step 2:  Extract archive to the ~/.emacs.d directory. This process will create the following two directories: ~/.emacs.d/color-theme-6.6.0 and ~/.emacs.d/color-theme-6.6.0/themes

Step 3:  Download (to the preferred location, e.g., ~/.emacs.d/color-theme-6.6.0/themes) the original source of the file that is presumably being used by the original poster of this particular thread -- i.e., color-theme-empty-void.el from ( http://www.emacswiki.org/emacs/download/color-theme-empty-void.el ). I choose to keep the same name of the file and I saved it to: ~/.emacs.d/color-theme-6.6.0/themes/color-theme-empty-void.el

Step 4:  Add the following lines of code to the .emacs file:

(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")

(require 'color-theme)

(color-theme-initialize)

(color-theme-empty-void)

Step 5:  Restart Emacs and enjoy.

6
  • It's not clear to me why you are adding to custom-theme-load-path, which is for Emacs custom themes, when the question is not about Emacs custom themes but about color themes, as defined by library color-theme.el. Custom themes and color themes are different. Am I missing something?
    – Drew
    Oct 8, 2014 at 3:00
  • @Drew -- I assumed the original poster wanted the best of both worlds -- i.e., that the O.P. wanted the ability to use the standard color-theme library, and that the O.P. also wanted a special theme called empty-void that was downloaded separately (with that empty-void theme loading automatically when Emacs starts).
    – lawlist
    Oct 8, 2014 at 4:30
  • Is the empty-void theme a custom theme then? If not, I still don't understand. (Not that I need to or that you need to help me understand. ;-))
    – Drew
    Oct 8, 2014 at 5:13
  • @Drew -- I'm guessing based on a quick Google of empty-void emacs theme that the O.P. might be using emacswiki.org/emacs/color-theme-empty-void.el However, the file name color-theme-empty-void.el is different than empty-void.el. I just downloaded color-theme-6.6.0.zip from download.savannah.gnu.org/releases/color-theme and did a word search of color-theme.el and didn't see anything that looked like empty-void. I don't know if empty-void.el (cited by the O.P.) was intended to be a custom theme or was instead to be used in conjunction with color-theme.
    – lawlist
    Oct 8, 2014 at 6:03
  • A google search for empty-void.el indicates that it is probably color-theme-empty-void.el that is meant.
    – Drew
    Oct 8, 2014 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .