Next: , Up: Flymake Implementation   [Contents][Index]

5.1 Determining whether syntax check is possible

Syntax check is considered possible if there’s an entry in flymake-allowed-file-name-masks matching buffer’s filename and its init-function returns non-nil value.

Two syntax check modes are distinguished:

  1. Buffer can be syntax checked in a standalone fashion, that is, the file (its temporary copy, in fact) can be passed over to the compiler to do the syntax check. Examples are C/C++ (.c, .cpp) and Java (.java) sources.
  2. Buffer can be syntax checked, but additional file, called master file, is required to perform this operation. A master file is a file that includes the current file, so that running a syntax check tool on it will also check syntax in the current file. Examples are C/C++ (.h, .hpp) headers.

These modes are handled inside init/cleanup/getfname functions, see Adding support for a new syntax check tool.

Flymake contains implementations of all functionality required to support different syntax check modes described above (making temporary copies, finding master files, etc.), as well as some tool-specific (routines for Make, Ant, etc.) code.