Toggle selective highlighting of patterns (Hi Lock mode).
With a prefix argument ARG, enable Hi Lock mode if ARG is
positive, and disable it otherwise. If called from Lisp, enable
the mode if ARG is omitted or nil.
Hi Lock mode is automatically enabled when you invoke any of the
highlighting commands listed below, such as M-s h r.
To enable Hi Lock mode in all buffers, use `global-hi-lock-mode'
or add (global-hi-lock-mode 1) to your init file.
In buffers where Font Lock mode is enabled, patterns are
highlighted using font lock. In buffers where Font Lock mode is
disabled, patterns are applied using overlays; in this case, the
highlighting will not be updated as you type.
When Hi Lock mode is enabled, a "Regexp Highlighting" submenu
is added to the "Edit" menu. The commands in the submenu,
which can be called interactively, are:
M-s h r REGEXP FACE
Highlight matches of pattern REGEXP in current buffer with FACE.
M-s h p PHRASE FACE
Highlight matches of phrase PHRASE in current buffer with FACE.
(PHRASE can be any REGEXP, but spaces will be replaced by matches
to whitespace and initial lower-case letters will become case insensitive.)
M-s h l REGEXP FACE
Highlight lines containing matches of REGEXP in current buffer with FACE.
M-s h u REGEXP
Remove highlighting on matches of REGEXP in current buffer.
M-s h w
Write active REGEXPs into buffer as comments (if possible). They may
be read the next time file is loaded or when the M-s h f command
is issued. The inserted regexps are in the form of font lock keywords.
(See `font-lock-keywords'.) They may be edited and re-loaded with M-s h f,
any valid `font-lock-keywords' form is acceptable. When a file is
loaded the patterns are read if `hi-lock-file-patterns-policy' is
'ask and the user responds y to the prompt, or if
`hi-lock-file-patterns-policy' is bound to a function and that
function returns t.
M-s h f
Re-read patterns stored in buffer (in the format produced by M-s h w).
When hi-lock is started and if the mode is not excluded or patterns
rejected, the beginning of the buffer is searched for lines of the
where FOO is a list of patterns. The patterns must start before
position (number of characters into buffer) `hi-lock-file-patterns-range'. Patterns will be read until Hi-lock: end is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'. (fn &optional ARG)