Syntax check tools are configured using the
flymake-proc-allowed-file-name-masks
list. Each item of this list
has the following format:
(filename-regexp, init-function, cleanup-function, getfname-function)
filename-regexp
This field is used as a key for locating init/cleanup/getfname
functions for the buffer. Items in
flymake-proc-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-function
init-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, but
flymake-mode
is not switched off.
cleanup-function
cleanup-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-function
This function is used for translating filenames reported by the syntax
check tool into “real” filenames. Filenames reported by the tool
will be different from the real ones, as actually the tool works with
the temporary copy. In most cases, the default implementation
provided by Flymake, flymake-proc-get-real-file-name
, can be
used as getfname-function
.
To add support for a new syntax check tool, write the 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-proc-err-line-patterns
list.
The following sections contain some examples of configuring Flymake support for various syntax check tools.