Next: , Previous: Determining whether syntax check is possible, Up: Flymake Implementation

5.2 Making a temporary copy

After the possibility of the syntax check has been determined, a temporary copy of the current buffer is made so that the most recent unsaved changes could be seen by the syntax check tool. Making a copy is quite straightforward in a standalone case (mode 1), as it's just saving buffer contents to a temporary file.

Things get trickier, however, when master file is involved, as it requires to

Locating a master file is discussed in the following section.

Patching just changes all appropriate lines of the master file so that they use the new (temporary) name of the current file. For example, suppose current file name is file.h, the master file is file.cpp, and it includes current file via #include "file.h". Current file's copy is saved to file file_flymake.h, so the include line must be changed to #include "file_flymake.h". Finally, patched master file is saved to file_flymake_master.cpp, and the last one is passed to the syntax check tool.