1. Home
  2. Computing & Technology
  3. Linux

Format Colors

Emacs Documentation

By Juergen Haas, About.com

Colors in Formatted Text

You can specify foreground and background colors for portions of the text. There is a menu for specifying the foreground color and a menu for specifying the background color. Each color menu lists all the colors that you have used in Enriched mode in the current Emacs session.

If you specify a color with a prefix argument--or, in Transient Mark mode, if the region is not active--then it applies to your next self-inserting input. See Transient Mark. Otherwise, the command applies to the region.

Each color menu contains one additional item: Other. You can use this item to specify a color that is not listed in the menu; it reads the color name with the minibuffer. To display list of available colors and their names, use the Display Colors menu item in the Text Properties menu (see Editing Format Info).

Any color that you specify in this way, or that is mentioned in a formatted text file that you read in, is added to both color menus for the duration of the Emacs session.

There are no key bindings for specifying colors, but you can do so with the extended commands M-x facemenu-set-foreground and M-x facemenu-set-background. Both of these commands read the name of the color with the minibuffer.

* Emacs Manual Index

Explore Linux

More from About.com

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux Software
  5. Editors
  6. Emacs
  7. Emacs Documentation - Format Colors

©2008 About.com, a part of The New York Times Company.

All rights reserved.