next up previous contents index
Next: Browser 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 color.sc §5.11 page gif).

Example:


tabular550

The colornames and the regular expressions are predefined in the file color.sc for the following modes: C, C++, Java, 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 and some lines are not displayed correctly. It is a display problem (the buffer is correct). In this case, use the Smac function remove_colors then color the buffer again else save and re-load the file.



Lionel Fournigault
Mon Dec 15 10:53:26 MET 1997