next up previous contents
Next: Default Window Parameters Up: Customizing your Environment Previous: Keyboard Shortcuts   Contents

Fonts and Colors

It should come as no surprise that you can change many aspects of the emacs user interface. Here are some commands that help you customize your work environment:

The default emacs frame or window might be good enough for some, but you may get tired of black on white or simply prefer another layout like yellow on blue (like the good old Wordperfect for DOS days), or white on grey (for writing at night in low light conditions) to give your eyes a rest.

Set the foreground color and background colors with M-x set-background-color and M-x set-foreground-color respectively. As you press return, a buffer window will open up requesting you input the color you like. If you're working in X (as opposed to at a console) you have dozens of colors at your disposal, while on a console you have just eight. Start typing 'bl' for blue and then press tab and note how many blues are available. Same goes for most colors. For that matter, you can choose the cursor color and mouse color in the same way, namely M-x set-cursor-color and M-x set-mouse-color.

If you decide to make these your defaults, it's a matter of adding something like the following to your .emacs preferences file:

(set-foreground-color "white")
(set-cursor-color "red")
(set-mouse-color "goldenrod")
(set-background-color "black")

I have never had much of a problem with emacs' default font, and since writers of long works don't have much need for font changing, once you've chosen a good font you can stick with it. Remember, since this is a text file the font is only used for display on the screen anyway, not printing. As of emacs 22 you can select your font using the cool GTK+ font chooser dialog. But if you want to do it the old/difficult way, type M-x set-default-font, and when emacs prompts you for a font, hit tab to see what's available. Note which one works the best for you, and then add it to your .emacs file with something like the following:

(set-default-font
"-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1")


next up previous contents
Next: Default Window Parameters Up: Customizing your Environment Previous: Keyboard Shortcuts   Contents
Randall Wood 2011-03-31