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 function:

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

Example:


tabular566

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:

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 function remove_colors then color the buffer again else save and re-load the file.



Lionel Fournigault
Wed Apr 30 10:44:37 MET DST 1997