Color syntax highlighting

next up previous contents index
Next: Writing new functions Up: Using Smac Previous: Regular expressions

Color syntax highlighting


In every mode (i.e. built-in modes and user modes), keywords or expressions can be set off by colors with the following Smac function:

This function can be used with the Smac regexp interface to color strings of your own modes (see §5.11 page gif).


The colornames and the regular expressions are predefined in the file for the following modes: C, C++, Latex, Html Perl, Ada, Fortran, shell-script and Edir. The standards Makefile, makefile, and Imakefile can also be colored. You can modify them or add colors for your own mode.

Default key bindings are:

ATTENTION When the current buffer has been modified by many operations, sometimes, colored strings do not match regular expressions nor keywords of the current mode. In this case, re-run color buffer (color region does not resolve the problem).

Lionel Fournigault
Mon Mar 6 13:33:34 MET 1995