Go to the first, previous, next, last section, table of contents.


9. Configuring Font Lock

Support for Font Lock in Proof General is described in the user manual (see the Syntax highlighting section). To configure Font Lock for a new proof assistant, you need to set the variable font-lock-keywords in each of the mode functions you want highlighting for. Proof General will automatically install these settings, and enable Font Lock minor mode (for syntax highlighting as you type) in script buffers.

To understand its format, check the documentation of font-lock-keywords inside Emacs.

Proof General has a special hack for simplifying font lock settings proof-font-lock-zap-commas, but it is recommended to restrict to using the font-lock-keywords setting if possible.

Variable: proof-font-lock-zap-commas
If non-nil, enable a font-lock hack which unfontifies commas.
If you fontify variables inside lists like [a,b,c] by matching on the brackets `[' and `]', you may take objection to the commas being coloured as well. In that case, enable this hack which will magically restore the commas to the default font for you.

The hack is rather painful and forces immediate fontification of files on loading (no lazy, caching locking). It is unreliable under GNU Emacs, to boot.

lego and Coq enable it by tradition.

Variable: pg-before-fontify-output-hook
This hook is called before fontifying a region in an output buffer.
A function on this hook can alter the region of the buffer within the current restriction, and must return the final value of (point-max). [This hook is presently only used by phox-sym-lock].


Go to the first, previous, next, last section, table of contents.