If you want to customize the colors in Emacs, specifying them in the .emacs init file, without installing any extra package, and without using a pre-made theme, something like this seems to work:

(set-background-color "#003c3c")
(set-foreground-color "#ffffff")
(set-face-background 'fringe "#253c3c")
(set-face-background 'cursor "#ffffff")
(set-face-background 'region "#ff0000")
(set-face-foreground 'font-lock-comment-face "#ff0000")
(set-cursor-color "#00ff00")

But for doing this, it would be useful to have a complete list of all the "keys" for these "key-value" pairs. (I don't know if "key" is the right term in Emacs-lingo.. just getting started with Emacs)

Is such a complete list available anywhere? Or can I somehow generate one?

(I currently use the GNU OSX version of Emacs in its own window, not in a terminal)


If you type M-x customize-face RET and then hit TAB, the completion window will provide a list of all faces, and you could copy the list from the completion window.

Or you could hit RET, and then you would be brought into the Emacs face customization interface, where you can change the colors and save them. This does not involve any extra packages or themes, and has been part of Emacs a long time (so you don't need to worry about which version you have).

  • Thanks for your answer! When I type M-x customize-faces and hit the TAB-button, Emacs changes it to M-x customize-apropos-faces. If I then press TAB again, it says [Sole completion]. Then I press the return-button, and it says Search for faces (word list or regexp):. Pressing return again gives a Wrong type argument: stringp, nil. Any idea? – gsr May 31 '14 at 14:48
  • Oops, I typed faces instead of face, and forgot a RET. Try now. – Alan Shutko May 31 '14 at 16:33
  • That was better. When I type M-x customize-face, hit RET, and then hit TAB, I get the list I think you're talking about. A plethora of completions. One of them, font-lock-keyword-face, I tried to customize with (set-face-foreground 'font-lock-keyword-face "#36648b"), and it works. But when I try the one called org-todo, it doesn't work. And org-mode is the reason I'm getting started with Emacs. I use version 24.3 btw. What could be the reason (set-face-foreground 'org-todo "#000000") doesn't work? – gsr May 31 '14 at 17:31
  • By "doesn't work", btw, I mean that Emacs responds on startup with: error: Invalid face, org-todo. – gsr May 31 '14 at 17:44
  • OK, it seems special ways are needed to define some of those faces. I managed to set org-todo and others with an expression like: (setq org-todo-keyword-faces '(("TODO" . "#36648b") ("NEXT" . "#ffff00") ("WAITING" . "#36648b") ("SOMEDAY" . "#36648b") ("DONE!" . "#000000"))) which I read about on orgmode.org/manual/Faces-for-TODO-keywords.html – gsr May 31 '14 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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