Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have downloaded zenburn.el that is a color-scheme for Emacs, but I don´t know how I can apply it to emacs. I am a beginner in emacs.

How do I apply my .el file to emacs? Can I do some linking from my .emacs-file?

I am using emacs23 on Linux Mint 8.

I have now installed color-theme with

sudo apt-get install emacs-goodies-el

But I don't get Zenburn when I start emacs, and there is no Zenburn when I do M-x color-theme-<TAB> <RETURN> in emacs.

This is my .emacs

(tool-bar-mode -1)

(add-to-list 'load-path "/home/sanoj/zenburn.el")
(require 'color-theme)
(load 'zenburn)  ;; requires that zenburn.el is in your load path
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-zenburn)))
share|improve this question
add comment

4 Answers 4

Most of your code is boilerplate code from color-theme installation guide so should work fine. Look at the things that are different.

(add-to-list 'load-path "/home/sanoj/")
(require 'color-theme)
(require 'zenburn)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-zenburn)))

Your add-to-list must take a DIRECTORY name as an argument, that's your first mistake. Also, you mustn't load zenburn, you must require it.

I just checked it on my emacs 23 on Arch and it works!

share|improve this answer
    
This one worked for me, thanks! –  3lectrologos Feb 26 '12 at 1:38
add comment

I'm an emacs newbie; but with emacs 23.2.1 on Vista, I got this by adding the following lines. I also had to name the file as ~/.emacs.d/zenburn-theme.el.

(require 'color-theme)
(load-theme 'zenburn)
(color-theme-zenburn)
share|improve this answer
add comment

thanks, doug. i'm running emacs 23 (emacs-snapshot-gtk and emacs-goodies-el .deb packages installed) on ubuntu 10.4. i found if i put the zenburn.el into my .emacs.d directory, i could omit the first line. also, i was getting errors from both the load and color-theme-initialize lines, so with these minor adjustments, your code works perfectly, and i have zenburn. YEAH!!!!! man. what a relief to the eyes. before this, i had been using X commandline parameters, or gnome keyboard shortcuts (windows_key + n) to reverse. but while these reversed the background, they were still too high contrast. so thank you for the last piece in the puzzle!

(require 'color-theme)
(load "~/.emacs.d/zenburn")
(eval-after-load "color-theme"
  '(progn
     (color-theme-zenburn)))
share|improve this answer
add comment

You need to load color-theme and initialize with something like this:

(add-to-list 'load-path "/path/to/color-theme.el/file")
(require 'color-theme)
(load 'zenburn)  ;; requires that zenburn.el is in your load path
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-zenburn)))

If your distribution of emacs doesn't already have color-theme installed, you'll need to download it first from http://www.nongnu.org/color-theme/

share|improve this answer
    
Did you change /path/to/color-theme.el/file? Did you load zenburn.el? I'll update my answer with an example. –  Doug Harris Apr 8 '10 at 15:05
    
zendburn.el (with a "d") or zenburn.el (without the "d")? I keep my own local el files in an elisp subdirectory under my home directory. I then have a line like the first one in my example to add /home/dharris/elisp to load-path. –  Doug Harris Apr 8 '10 at 15:24
    
Sorry I meant zenburn.el, and I have listed my .emacs in my question now. –  Jonas Apr 8 '10 at 15:44
    
Do I have to load it with any command or should the colors just be there when I start emacs? –  Jonas Apr 8 '10 at 16:09
    
I'm not sure how much more I can help with this since I can't see everything in your set up. Take a look for interesting error messages in the Messages buffer. You might also find some useful stuff on the color theme page on the emacs wiki: emacswiki.org/emacs/ColorTheme –  Doug Harris Apr 8 '10 at 16:30
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.