21

I found this website and downloaded the color-theme files. It says:

Put the file color-theme.el and the folder “themes” (with the files color-theme-example.el and color-theme-library.el) in a directory on your LoadPath.

and then I checked the load path website, which says:

To add a single directory to the load-path:

(add-to-list 'load-path "~/.emacs.d/site-lisp/")

My question is, where do I type this line? If I do M-x and then type, it complains add-to-list[No match].

By the way, I am using Emacs 23.2(9.0) on Mac, a GUI version. For the text version on terminal, I use black background seems fine, except the blue is too dark on black

5 Answers 5

37

An answer for newbs like me!

In Emacs 24.5.1, on mac or linux the following will work.

The following command will create a folder called themes inside your .emacs.d folder (assuming one does not already exist)

mkdir ~/.emacs.d/themes/

Now tell emacs that you have installed a themes folder. In emacs open your .emacs file, by typing the following:

C-x C-f ;;;this opens a new .emacs file or creates one if it doesn't exist

Add the following line to your .emacs file:

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

Now copy your theme's '.el' file to your .emacs.d/themes/ directory. A good place to find custom themes is here: emacsthemes.com

Now load your custom theme by typing the following:

M-x customize-themes ;;;now press return

Your newly installed themes should appear on the list like so:

emacs *Custom Themes* buffer

Move your cursor to within the '[ ]' and press return to select that theme.

Enjoy emacs!

2
  • 2
    M-x customize-themes working for me, not M-x customise-themes. Feb 16, 2016 at 20:37
  • 1
    Yeah, Emacs understands British English :)
    – runlevel0
    Jul 31 at 11:18
13

You can download Emacs 24 for Mac from here and Emacs 24 already has a built-in theming system. You can call it by M-x customize-themes and choose whatever themes you like. And you can find much more themes online. There is actually a quite nice theme called "solarized", you can use it both in GUI and command line.

9

I load color theme by this code:

(load-file "~/.emacs.d/color-theme/themes/zenburn.el")
(zenburn)
1
  • I assume this goes to the .emacs file, right? Is there a way to check where the init file my emacs is actually looking for. Because I am using the Mac OS GUI version, I suspect it doesn't check .emacs at ~ May 13, 2011 at 15:23
2

You should put that line in your init file. This is usually the file ~/.emacs. The .emacs.d directory is a conventional directory for storing your personal customization files. Many of the instructions for installing packages (like color theme) or explaining other parts of Emacs (like the load-path page) assume you understand the init file.

.emacs and .emacs.d are really at the core of Emacs customization. If you read up on those, Emacs will make a lot more sense. I hope that helps!

2
  • Thanks a lot, John, would you please point me to a sample .emacs file? May 13, 2011 at 15:21
  • I get it working now. Here is my .emacs ;; Color theme (add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0") (add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0/themes") (require 'color-theme) (color-theme-initialize) (setq color-theme-is-global t) (color-theme-arjen) May 13, 2011 at 15:48
2

In emacs 23, I thought color theme is installed by default. If not, and you need to add that line, write it in either file ~/.emacs.d/init.el, ~/.emacs.el or ~/.emacs

10
  • thanks! so .emacs or .emacs.el doesn't exist in my ~, I am just wondering where is the default "loadpath". May 12, 2011 at 18:32
  • 1
    Strange. If you are using linux, you should have it. But even if you don't, you can just create a file named like that, and it will work by default.
    – sawa
    May 12, 2011 at 18:36
  • I am using Mac OS. I created it and added the line. It seems it still cannot load the color theme mode. I am feeling this troublesome. If there is a version with default color theme installed, I am happy using that. May 12, 2011 at 18:44
  • What happens if you put .emacs.el within .emacs.d? Maybe you should further change the file name so that you have .emacs.d/init.el.
    – sawa
    May 12, 2011 at 18:51
  • I found a version has default installation May 12, 2011 at 19:02

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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