Previous: Customizable variables, Up: Configuring Flymake
Syntax check tools are configured using the
flymake-allowed-file-name-masks list. Each item of this list
has the following format:
(filename-regexp, init-function, cleanup-function, getfname-function)
filename-regexpflymake-allowed-file-name-masks are searched sequentially. The
first item with filename-regexp matching buffer filename is
selected. If no match is found, flymake-mode is switched off.
init-functioninit-function is required to initialize the syntax check,
usually by creating a temporary copy of the buffer contents. The
function must return (list cmd-name arg-list). If
init-function returns null, syntax check is aborted, by
flymake-mode is not switched off.
cleanup-functioncleanup-function is called after the syntax check process is
complete and should take care of proper deinitialization, which is
usually deleting a temporary copy created by the init-function.
getfname-functionflymake-get-real-file-name, can be used as
getfname-function.
To add support for a new syntax check tool, write corresponding
init-function, and, optionally cleanup-function and
getfname-function. If the format of error messages reported by
the new tool is not yet supported by Flymake, add a new entry to
the flymake-err-line-patterns list.
The following sections contain some examples of configuring Flymake support for various syntax check tools.