Mac – How to apply a color-scheme (.el file) in emacs

colorselispemacs

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)))

Best Answer

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/