Changing color of keywords in Emacs editor

Technote (FAQ)


How do you change the color of keywords if you are using the Emacs editor?

IBM no longer owns this product but is providing its technical support documents "AS-IS" for Atego customer benefit until 1 May 2013. For information about technical assistance, visit


If you are using Emacs editor with IBM Rational Apex, it is possible to change the color of keywords.

To do this place the following in your .emacs file:

(add-hook 'c-mode-hook 'turn-on-font-lock)
(add-hook 'ada-mode-hook 'turn-on-font-lock)

In Apex, Emacs windows obtain color definitions from the same Apex X resources that apply to Apex's non-emacs (Motif) windows. Note that this is different from the usual methods that are used to define colors in standard Emacs.

The default values for these X resources are defined in file $APEX_HOME/app-defaults/Rational-color. These resources settings may be user defined by copying them from file Rational-color into a file in your home directory called "Rational", which you may need to create. Then simply change the color name to one of the color names defined in file /usr/openwin/lib/rgb.txt. The changes will take effect the next time you start Apex.

Cross reference information
Segment Product Component Platform Version Edition
Software Development Rational Ada Developer --

Rate this page:

(0 users)Average rating

Document information

More support for:

Rational Apex

Software version:

3.0.0b, 3.0.1, 3.2.0b, 4.0.0b, 4.0.0c, 4.2.0b, 4.2.2b, 4.4.0

Operating system(s):

AIX, HP-UX, IRIX, Linux, Solaris, TRU64 UNIX

Reference #:


Modified date:


Translate my page

Machine Translation

Content navigation