|• Example---Configuring a tool called directly|
|• Example---Configuring a tool called via make|
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)
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 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 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
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
To add support for a new syntax check tool, write the corresponding
init-function and, optionally,
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 following sections contain some examples of configuring Flymake support for various syntax check tools.