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?
.emacs.d
root directory is not automatically included within theload-path
. A path to an*.el
file is not usually used in conjunction withload-path
, but instead is normally used in conjunction withload-file
-- without usingadd-to-list
. So those are likely your first two problems right off the bat.(load-file "~/.emacs.d/empty-void.el") (load-file "~/.emacs.d/color-theme.el")
and then not even worry about theload-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 yourload-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 torequire
.load-file
did the trick for me, thanks a lot!