Frank C. Weiler asks me about emacs color


On 2007-04-29 Frank C. Weiler asks the following (on my about me page as it happens):

Dear DRJ11, I have been trying too long to locate where in the Emacs distribution a particular colour scheme is defined for a particular distribution that I have grown to like (Mandrake 10). I now run Fedora 6, but their solour scheme is black and white, and trheir window scheme sucks. I program in Fortran (all varieties), C, awk, and others, and like the fact that reserved words, constructs, etc, all appear in color, on a standard medium green background (soothing to the eyes) and a tan-yellow type set. Anyway, you seem to have found out all about Emacs colour, so can you point me in the correct direction? In really want to extract this colour scheme from this old version and tuck it away for all future invocations that I use.

Well, I don’t actually know much about emacs, and less about color. Did you read the bit in Stupid colour, stupid slime, stupid emacs where I say that I only use emacs for programming in elisp, info-mode, and inferior-lisp mode? I don’t use it for editing files (I do that in vi). Also, syntax highlighting generally annoys me so I usually switch it off.

So I’m not sure you’ve come to the right person.

Having said all that though, you might find the “frame parameters” node of the emacs info manual useful (C-h i d m emacs <RET> g frame parameters <RET> at least on my emacs 21.2.1 distribution that came with my MacBook).

And it seems to matter a lot whether you run emacs in tty-mode (inside a Terminal window, like I do), or as an X application (which is probably much more common these days).

Good luck.


One Response to “Frank C. Weiler asks me about emacs color”

  1. Gareth Rees Says:

    Syntax highlighting is (usually) handled by the font-lock module. Essentially each programming language mode provides a dictionary mapping bits of syntax to the face in which to display that syntax. The modes don’t generally specify a colour scheme themselves: they just reference font-lock-keyword-face for keywords, font-lock-comment-face for comments and so on. The colour scheme is specified in the font-lock module itself. You can customize the colours, fonts, etc using M-x customize-face RET and then press TAB for a list of faces.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: