Reputation: 168
To start off, my Emacs version is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-06-06 on barber, modified by Debian
, and I am running Debian Jessie as the sole OS on a 2009 Macbook Pro.
So I've downloaded lots of themes off the net that I think would make working in Emacs much more soothing, and placed them in my ~/.emacs.d/themes/
folder. I've downloaded the emacs-goodies-el
packages. I've set the custom load path for these themes to be in that specific folder. When I start, I either get one of two things depending on if I actually try to load the themes with (load-theme tron t)
, or not. Both errors are of the type Symbol's value as variable is void: <!DOCTYPE
.
When I run Emacs in --debut-init
, this is what I get:
Debugger entered--Lisp error: (void-variable <!DOCTYPE)
eval-buffer() ; Reading at buffer position 14
load-theme(jazz t)
eval-buffer(#<buffer *load*> nil "/home/finnds/.emacs" nil t) ;
Reading at buffer position 1203
load-with-code-conversion("/home/finnds/.emacs" "/home/finnds/.emacs" t t)
load("~/.emacs" t t)
#[0 "\205\262
When I try to load themes through M-x customize-themes
, I get the error: load-theme: Symbol's value as variable is void: <!DOCTYPE
, and all the colors go back to being white/light/default.
And here is my .emacs
file, after the custom-set-variables
and custom-set-faces
(meaning this is put all the way at the bottom of the file):
(add-to-list 'custom-theme-load-path "~/.emacs.d/")
(load-theme 'jazz t)
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)))
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
I've tried doing exactly what the wiki tells me to do, and several other themesites, but I still keep getting this message. I tried searching for an answer, but there wasn't a particular one like my exact case, I found. Can anyone help me out here? Thanks in advance!
Upvotes: 3
Views: 3100
Reputation: 30701
You are trying to load an HTML file, not an Emacs-Lisp file. It sounds like you saved the file wrong. <!DOCTYPE
is what tells you this.
The article written by Bozhidar B. and cited by him is misleading. I recommend the EmacsWiki page about this instead. It fairly compares and contrasts color themes, which are provided by library color-theme.el
, and custom themes, which were added to vanilla Emacs 24.
These two kinds of theme are not the same thing, and neither replaces the other, in spite of what you might hear. Each has its advantages (and disadvantages) and use cases.
And yes, you can use both -- it is not true that "you shouldn't be doing" this. Read the wiki page, get to know both of them, and then make up your own mind about what works for you.
I say this with no horse in the race. My code (Icicles and Do Re Mi) that lets you cycle themes etc. supports both kinds of themes equally: color themes and custom themes.
Upvotes: 3
Reputation: 56595
You're mixing the old color theme handling (based on the color-theme
package) and the Emacs 24.x built-in support for themes, which you shouldn't be doing. I'd suggest having a look at this article to learn more about color themes in Emacs. Here's a minimal setup example (using the zenburn theme):
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
(unless (package-installed-p 'zenburn-theme) (package-install 'zenburn-theme))
(load-theme 'zenburn t)
To load a theme that's locally available:
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'theme-name t)
This assumes that you've placed an Emacs 24 compatible theme named theme-name
in your ~/.emacs.d/themes
folder.
Upvotes: 3