flymake: Locating a master file
5.3 Locating a master file
==========================
Master file is located in two steps.
First, a list of possible master files is built. A simple name
matching is used to find the files. For a C++ header ‘file.h’, Flymake
searches for all ‘.cpp’ files in the directories whose relative paths
are stored in a customizable variable ‘flymake-master-file-dirs’, which
usually contains something like ‘("." "./src")’. No more than
‘flymake-master-file-count-limit’ entries is added to the master file
list. The list is then sorted to move files with names ‘file.cpp’ to
the top.
Next, each master file in a list is checked to contain the
appropriate include directives. No more than ‘flymake-check-file-limit’
of each file are parsed.
For ‘file.h’, the include directives to look for are ‘#include
"file.h"’, ‘#include "../file.h"’, etc. Each include is checked against
a list of include directories (see Getting the include
directories) to be sure it points to the correct ‘file.h’.
First matching master file found stops the search. The master file
is then patched and saved to disk. In case no master file is found,
syntax check is aborted, and corresponding status (!) is reported in
the mode line.