Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / doc / misc / flymake.texi
CommitLineData
4009494e
GM
1\input texinfo @c -*-texinfo-*-
2@comment %**start of header
db78a8cb 3@setfilename ../../info/flymake
4009494e
GM
4@set VERSION 0.3
5@set UPDATED April 2004
6@settitle GNU Flymake @value{VERSION}
7@syncodeindex pg cp
8@comment %**end of header
9
10@copying
11This manual is for GNU Flymake (version @value{VERSION}, @value{UPDATED}),
12which is a universal on-the-fly syntax checker for GNU Emacs.
13
acaf905b 14Copyright @copyright{} 2004-2012
9360256a 15Free Software Foundation, Inc.
4009494e
GM
16
17@quotation
18Permission is granted to copy, distribute and/or modify this document
6a2c4aec 19under the terms of the GNU Free Documentation License, Version 1.3 or
4009494e
GM
20any later version published by the Free Software Foundation; with no
21Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
22and with the Back-Cover Texts as in (a) below. A copy of the license
debf4439 23is included in the section entitled ``GNU Free Documentation License''.
4009494e 24
6f093307
GM
25(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
26modify this GNU manual. Buying copies from the FSF supports it in
27developing GNU and promoting software freedom.''
4009494e
GM
28@end quotation
29@end copying
30
0c973505 31@dircategory Emacs misc features
4009494e 32@direntry
62e034c2 33* Flymake: (flymake). A universal on-the-fly syntax checker.
4009494e
GM
34@end direntry
35
36@titlepage
37@title GNU Flymake
38@subtitle for version @value{VERSION}, @value{UPDATED}
39@author Pavel Kobiakov(@email{pk_at_work@@yahoo.com})
40@page
41@vskip 0pt plus 1filll
42@insertcopying
43@end titlepage
44
45@contents
46
47@ifnottex
48@node Top
49@top GNU Flymake
5dc584b5 50@insertcopying
4009494e
GM
51@end ifnottex
52
53@menu
54* Overview of Flymake::
55* Installing Flymake::
56* Using Flymake::
57* Configuring Flymake::
58* Flymake Implementation::
59* GNU Free Documentation License::
60* Index::
61@end menu
62
63@node Overview of Flymake
64@chapter Overview
65@cindex Overview of Flymake
66
67Flymake is a universal on-the-fly syntax checker implemented as an
68Emacs minor mode. Flymake runs the pre-configured syntax check tool
69(compiler for C++ files, @code{perl} for perl files, etc.) in the
70background, passing it a temporary copy of the current buffer, and
71parses the output for known error/warning message patterns. Flymake
72then highlights erroneous lines (i.e. lines for which at least one
73error or warning has been reported by the syntax check tool), and
74displays an overall buffer status in the mode line. Status information
75displayed by Flymake contains total number of errors and warnings
76reported for the buffer during the last syntax check.
77
78@code{flymake-goto-next-error} and @code{flymake-goto-prev-error}
79functions allow for easy navigation to the next/previous erroneous
80line, respectively.
81
82Calling @code{flymake-display-err-menu-for-current-line} will popup a
83menu containing error messages reported by the syntax check tool for
84the current line. Errors/warnings belonging to another file, such as a
85@code{.h} header file included by a @code{.c} file, are shown in the
86current buffer as belonging to the first line. Menu items for such
87messages also contain a filename and a line number. Selecting such a
88menu item will automatically open the file and jump to the line with
89error.
90
91Syntax check is done 'on-the-fly'. It is started whenever
92
93@itemize @bullet
94@item buffer is loaded
95@item a newline character is added to the buffer
96@item some changes were made to the buffer more than @code{0.5} seconds ago (the
97delay is configurable).
98@end itemize
99
100Flymake is a universal syntax checker in the sense that it's easily
101extended to support new syntax check tools and error message
102patterns. @xref{Configuring Flymake}.
103
104@node Installing Flymake
105@chapter Installing
106@cindex Installing Flymake
107
108
109Flymake is packaged in a single file, @code{flymake.el}.
110
111To install/update Flymake, place @code{flymake.el} to a directory
112somewhere on Emacs load path. You might also want to byte-compile
113@code{flymake.el} to improve performance.
114
115Also, place the following line in the @code{.emacs} file.
116
117@lisp
118(require 'flymake)
119@end lisp
120
121You might also map the most frequently used Flymake functions, such as
122@code{flymake-goto-next-error}, to some keyboard shortcuts:
123
124@lisp
125(global-set-key [f3] 'flymake-display-err-menu-for-current-line)
126(global-set-key [f4] 'flymake-goto-next-error)
127@end lisp
128
129@node Using Flymake
130@chapter Using Flymake
131@cindex Using Flymake
132
133@menu
134* Flymake mode::
135* Running the syntax check::
136* Navigating to error lines::
137* Viewing error messages::
138* Syntax check statuses::
139* Troubleshooting::
140@end menu
141
142@node Flymake mode
143@section Flymake mode
144@cindex flymake-mode
145
146Flymake is an Emacs minor mode. To use Flymake, you
147must first activate @code{flymake-mode} by using the
148@code{flymake-mode} function.
149
150Instead of manually activating @code{flymake-mode}, you can configure
151Flymake to automatically enable @code{flymake-mode} upon opening any
152file for which syntax check is possible. To do so, place the following
153line in @code{.emacs}:
154
155@lisp
156(add-hook 'find-file-hook 'flymake-find-file-hook)
157@end lisp
158
159@node Running the syntax check
160@section Running the syntax check
161@cindex Manually starting the syntax check
162
163When @code{flymake-mode} is active, syntax check is started
164automatically on any of the three conditions mentioned above. Syntax
165check can also be started manually by using the
166@code{flymake-start-syntax-check-for-current-buffer} function. This
167can be used, for example, when changes were made to some other buffer
168affecting the current buffer.
169
170@node Navigating to error lines
171@section Navigating to error lines
172@cindex Navigating to error lines
173
174After syntax check is completed, lines for which at least one error or
175warning has been reported are highlighted, and total number of errors
176and warning is shown in the mode line. Use the following functions to
177navigate the highlighted lines.
178
179@multitable @columnfractions 0.25 0.75
180
181@item @code{flymake-goto-next-error}
182@tab Moves point to the next erroneous line, if any.
183
184@item @code{flymake-goto-prev-error}
185@tab Moves point to the previous erroneous line.
186
187@end multitable
188
189These functions treat erroneous lines as a linked list. Therefore,
190@code{flymake-goto-next-error} will go to the first erroneous line
191when invoked in the end of the buffer.
192
193@node Viewing error messages
194@section Viewing error messages
195@cindex Viewing error messages
196
197To view error messages belonging to the current line, use the
198@code{flymake-display-err-menu-for-current-line} function. If there's
199at least one error or warning reported for the current line, this
200function will display a popup menu with error/warning texts.
201Selecting the menu item whose error belongs to another file brings
202forward that file with the help of the
203@code{flymake-goto-file-and-line} function.
204
205@node Syntax check statuses
206@section Syntax check statuses
207@cindex Syntax check statuses
208
209After syntax check is finished, its status is displayed in the mode line.
210The following statuses are defined.
211
212@multitable @columnfractions 0.25 0.75
213@item Flymake* or Flymake:E/W*
214@tab Flymake is currently running. For the second case, E/W contains the
215 error and warning count for the previous run.
216
217@item Flymake
218@tab Syntax check is not running. Usually this means syntax check was
219 successfully passed (no errors, no warnings). Other possibilities are:
220 syntax check was killed as a result of executing
221 @code{flymake-compile}, or syntax check cannot start as compilation
222 is currently in progress.
223
224@item Flymake:E/W
225@tab Number of errors/warnings found by the syntax check process.
226
227@item Flymake:!
228@tab Flymake was unable to find master file for the current buffer.
229@end multitable
230
231The following errors cause a warning message and switch flymake mode
232OFF for the buffer.
233
234@multitable @columnfractions 0.25 0.75
235@item CFGERR
236@tab Syntax check process returned nonzero exit code, but no
237 errors/warnings were reported. This indicates a possible configuration
238 error (for example, no suitable error message patterns for the
239 syntax check tool).
240
241@item NOMASTER
242@tab Flymake was unable to find master file for the current buffer.
243
244@item NOMK
245@tab Flymake was unable to find a suitable buildfile for the current buffer.
246
247@item PROCERR
248@tab Flymake was unable to launch a syntax check process.
249@end multitable
250
251
252@node Troubleshooting
253@section Troubleshooting
254@cindex Logging
255@cindex Troubleshooting
256
257Flymake uses a simple logging facility for indicating important points
258in the control flow. The logging facility sends logging messages to
259the @code{*Messages*} buffer. The information logged can be used for
260resolving various problems related to Flymake.
261
262Logging output is controlled by the @code{flymake-log-level}
263variable. @code{3} is the most verbose level, and @code{-1} switches
264logging off.
265
266@node Configuring Flymake
267@chapter Configuring and Extending Flymake
268@cindex Configuring and Extending Flymake
269
270@menu
271* Customizable variables::
272* Adding support for a new syntax check tool::
273@end menu
274
275Flymake was designed to be easily extended for supporting new syntax
276check tools and error message patterns.
277
278@node Customizable variables
279@section Customizable variables
280@cindex Customizable variables
281
282This section summarizes variables used for Flymake
283configuration.
284
285@table @code
286@item flymake-log-level
287Controls logging output, see @ref{Troubleshooting}.
288
289@item flymake-allowed-file-name-masks
290A list of @code{(filename-regexp, init-function, cleanup-function
291getfname-function)} for configuring syntax check tools. @xref{Adding
292support for a new syntax check tool}.
293
294@item flymake-buildfile-dirs
295A list of directories (relative paths) for searching a
296buildfile. @xref{Locating the buildfile}.
297
298@item flymake-master-file-dirs
299A list of directories for searching a master file. @xref{Locating a
300master file}.
301
302@item flymake-get-project-include-dirs-function
303A function used for obtaining a list of project include dirs (C/C++
304specific). @xref{Getting the include directories}.
305
306@item flymake-master-file-count-limit
307@itemx flymake-check-file-limit
308Used when looking for a master file. @xref{Locating a master file}.
309
310@item flymake-err-line-patterns
311Patterns for error/warning messages in the form @code{(regexp file-idx
176c6903 312line-idx col-idx err-text-idx)}. @xref{Parsing the output}.
4009494e
GM
313
314@item flymake-compilation-prevents-syntax-check
315A flag indicating whether compilation and syntax check of the same
316file cannot be run simultaneously.
317
318@item flymake-no-changes-timeout
319If any changes are made to the buffer, syntax check is automatically
320started after @code{flymake-no-changes-timeout} seconds.
321
322@item flymake-gui-warnings-enabled
323A boolean flag indicating whether Flymake will show message boxes for
324non-recoverable errors. If @code{flymake-gui-warnings-enabled} is
325@code{nil}, these errors will only be logged to the @code{*Messages*}
326buffer.
327
328@item flymake-start-syntax-check-on-newline
329A boolean flag indicating whether to start syntax check after a
330newline character is added to the buffer.
331
176c6903 332@item flymake-errline
4009494e
GM
333A custom face for highlighting lines for which at least one error has
334been reported.
335
176c6903 336@item flymake-warnline
4009494e
GM
337A custom face for highlighting lines for which at least one warning
338and no errors have been reported.
339
340@end table
341
342@node Adding support for a new syntax check tool
343@section Adding support for a new syntax check tool
344@cindex Adding support for a new syntax check tool
345
346@menu
347* Example -- Configuring a tool called directly::
348* Example -- Configuring a tool called via make::
349@end menu
350
351Syntax check tools are configured using the
352@code{flymake-allowed-file-name-masks} list. Each item of this list
353has the following format:
354
355@lisp
356(filename-regexp, init-function, cleanup-function, getfname-function)
357@end lisp
358
359@table @code
360@item filename-regexp
361This field is used as a key for locating init/cleanup/getfname
362functions for the buffer. Items in
363@code{flymake-allowed-file-name-masks} are searched sequentially. The
364first item with @code{filename-regexp} matching buffer filename is
365selected. If no match is found, @code{flymake-mode} is switched off.
366
367@item init-function
368@code{init-function} is required to initialize the syntax check,
369usually by creating a temporary copy of the buffer contents. The
370function must return @code{(list cmd-name arg-list)}. If
371@code{init-function} returns null, syntax check is aborted, by
372@code{flymake-mode} is not switched off.
373
374@item cleanup-function
375@code{cleanup-function} is called after the syntax check process is
376complete and should take care of proper deinitialization, which is
377usually deleting a temporary copy created by the @code{init-function}.
378
379@item getfname-function
380This function is used for translating filenames reported by the syntax
381check tool into ``real'' filenames. Filenames reported by the tool
382will be different from the real ones, as actually the tool works with
383the temporary copy. In most cases, the default implementation
384provided by Flymake, @code{flymake-get-real-file-name}, can be used as
385@code{getfname-function}.
386
387@end table
388
389To add support for a new syntax check tool, write corresponding
390@code{init-function}, and, optionally @code{cleanup-function} and
391@code{getfname-function}. If the format of error messages reported by
392the new tool is not yet supported by Flymake, add a new entry to
393the @code{flymake-err-line-patterns} list.
394
395The following sections contain some examples of configuring Flymake
396support for various syntax check tools.
397
398@node Example -- Configuring a tool called directly
399@subsection Example -- Configuring a tool called directly
400@cindex Adding support for perl
401
402In this example, we will add support for @code{perl} as a syntax check
403tool. @code{perl} supports the @code{-c} option which does syntax
404checking.
405
406First, we write the @code{init-function}:
407
408@lisp
176c6903 409(defun flymake-perl-init ()
4009494e 410 (let* ((temp-file (flymake-init-create-temp-buffer-copy
176c6903 411 'flymake-create-temp-inplace))
9360256a 412 (local-file (file-relative-name
5ef5ef3f
RS
413 temp-file
414 (file-name-directory buffer-file-name))))
4009494e
GM
415 (list "perl" (list "-wc " local-file))))
416@end lisp
417
418@code{flymake-perl-init} creates a temporary copy of the buffer
419contents with the help of
420@code{flymake-init-create-temp-buffer-copy}, and builds an appropriate
421command line.
422
423Next, we add a new entry to the
424@code{flymake-allowed-file-name-masks}:
425
426@lisp
427(setq flymake-allowed-file-name-masks
428 (cons '(".+\\.pl$"
429 flymake-perl-init
430 flymake-simple-cleanup
431 flymake-get-real-file-name)
432 flymake-allowed-file-name-masks))
433@end lisp
434
435Note that we use standard @code{cleanup-function} and
436@code{getfname-function}.
437
438Finally, we add an entry to @code{flymake-err-line-patterns}:
439
440@lisp
441(setq flymake-err-line-patterns
442 (cons '("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]"
443 2 3 nil 1)
444 flymake-err-line-patterns))
445@end lisp
446
447@node Example -- Configuring a tool called via make
448@subsection Example -- Configuring a tool called via make
449@cindex Adding support for C (gcc+make)
450
451In this example we will add support for C files syntax checked by
452@code{gcc} called via @code{make}.
453
454We're not required to write any new functions, as Flymake already has
455functions for @code{make}. We just add a new entry to the
456@code{flymake-allowed-file-name-masks}:
457
458@lisp
459(setq flymake-allowed-file-name-masks
460 (cons '(".+\\.c$"
461 flymake-simple-make-init
462 flymake-simple-cleanup
463 flymake-get-real-file-name)
464 flymake-allowed-file-name-masks))
465@end lisp
466
467@code{flymake-simple-make-init} builds the following @code{make}
468command line:
469
470@lisp
471(list "make"
472 (list "-s" "-C"
473 base-dir
474 (concat "CHK_SOURCES=" source)
475 "SYNTAX_CHECK_MODE=1"
476 "check-syntax"))
477@end lisp
478
479@code{base-dir} is a directory containing @code{Makefile}, see @ref{Locating the buildfile}.
480
481Thus, @code{Makefile} must contain the @code{check-syntax} target. In
482our case this target might look like this:
483
484@verbatim
485check-syntax:
064e2d08 486 gcc -o /dev/null -S ${CHK_SOURCES}
4009494e
GM
487@end verbatim
488
489The format of error messages reported by @code{gcc} is already
490supported by Flymake, so we don't have to add a new entry to
491@code{flymake-err-line-patterns}.
492
493@node Flymake Implementation
494@chapter Flymake Implementation
495@cindex Implementation details
496
497@menu
498* Determining whether syntax check is possible::
499* Making a temporary copy::
500* Locating a master file::
501* Getting the include directories::
502* Locating the buildfile::
503* Starting the syntax check process::
504* Parsing the output::
505* Highlighting erroneous lines::
506* Interaction with other modes::
507@end menu
508
509Syntax check is started by calling @code{flymake-start-syntax-check-for-current-buffer}.
510Flymake first determines whether it is able to do syntax
511check. It then saves a copy of the buffer in a temporary file in the
512buffer's directory (or in the system temp directory -- for java
513files), creates a syntax check command and launches a process with
514this command. The output is parsed using a list of error message patterns,
515and error information (file name, line number, type and text) is
516saved. After the process has finished, Flymake highlights erroneous
517lines in the buffer using the accumulated error information.
518
519@node Determining whether syntax check is possible
520@section Determining whether syntax check is possible
521@cindex Syntax check models
522@cindex Master file
523
524Syntax check is considered possible if there's an entry in
525@code{flymake-allowed-file-name-masks} matching buffer's filename and
526its @code{init-function} returns non-@code{nil} value.
527
528Two syntax check modes are distinguished:
529
530@enumerate
531
532@item
533Buffer can be syntax checked in a standalone fashion, that is, the
534file (its temporary copy, in fact) can be passed over to the compiler to
535do the syntax check. Examples are C/C++ (.c, .cpp) and Java (.java)
536sources.
537
538@item
539Buffer can be syntax checked, but additional file, called master file,
540is required to perform this operation. A master file is a file that
541includes the current file, so that running a syntax check tool on it
542will also check syntax in the current file. Examples are C/C++ (.h,
543.hpp) headers.
544
545@end enumerate
546
547These modes are handled inside init/cleanup/getfname functions, see
548@ref{Adding support for a new syntax check tool}.
549
550Flymake contains implementations of all functionality required to
551support different syntax check modes described above (making
552temporary copies, finding master files, etc.), as well as some
553tool-specific (routines for @code{make}, @code{Ant}, etc.) code.
554
555
556@node Making a temporary copy
557@section Making a temporary copy
558@cindex Temporary copy of the buffer
559@cindex Master file
560
561After the possibility of the syntax check has been determined, a
562temporary copy of the current buffer is made so that the most recent
563unsaved changes could be seen by the syntax check tool. Making a copy
564is quite straightforward in a standalone case (mode @code{1}), as it's
565just saving buffer contents to a temporary file.
566
567Things get trickier, however, when master file is involved, as it
568requires to
569
570@itemize @bullet
571@item locate a master file
572@item patch it to include the current file using its new (temporary)
573name.
574@end itemize
575
576Locating a master file is discussed in the following section.
577
578Patching just changes all appropriate lines of the master file so that they
579use the new (temporary) name of the current file. For example, suppose current
580file name is @code{file.h}, the master file is @code{file.cpp}, and
581it includes current file via @code{#include "file.h"}. Current file's copy
582is saved to file @code{file_flymake.h}, so the include line must be
583changed to @code{#include "file_flymake.h"}. Finally, patched master file
584is saved to @code{file_flymake_master.cpp}, and the last one is passed to
585the syntax check tool.
586
587@node Locating a master file
588@section Locating a master file
589@cindex Master file
590
591Master file is located in two steps.
592
593First, a list of possible master files is built. A simple name
594matching is used to find the files. For a C++ header @code{file.h},
595Flymake searches for all @code{.cpp} files in the directories whose relative paths are
596stored in a customizable variable @code{flymake-master-file-dirs}, which
597usually contains something like @code{("." "./src")}. No more than
598@code{flymake-master-file-count-limit} entries is added to the master file
599list. The list is then sorted to move files with names @code{file.cpp} to
600the top.
601
602Next, each master file in a list is checked to contain the appropriate
603include directives. No more than @code{flymake-check-file-limit} of each
604file are parsed.
605
606For @code{file.h}, the include directives to look for are
607@code{#include "file.h"}, @code{#include "../file.h"}, etc. Each
608include is checked against a list of include directories
609(see @ref{Getting the include directories}) to be sure it points to the
610correct @code{file.h}.
611
612First matching master file found stops the search. The master file is then
613patched and saved to disk. In case no master file is found, syntax check is
614aborted, and corresponding status (!) is reported in the mode line.
615
616@node Getting the include directories
617@section Getting the include directories
618@cindex Include directories (C/C++ specific)
619
620Two sets of include directories are distinguished: system include directories
621and project include directories. The former is just the contents of the
622@code{INCLUDE} environment variable. The latter is not so easy to obtain,
623and the way it can be obtained can vary greatly for different projects.
624Therefore, a customizable variable
625@code{flymake-get-project-include-dirs-function} is used to provide the
626way to implement the desired behavior.
627
628The default implementation, @code{flymake-get-project-include-dirs-imp},
629uses a @code{make} call. This requires a correct base directory, that is, a
630directory containing a correct @code{Makefile}, to be determined.
631
632As obtaining the project include directories might be a costly operation, its
633return value is cached in the hash table. The cache is cleared in the beginning
634of every syntax check attempt.
635
636@node Locating the buildfile
637@section Locating the buildfile
638@cindex Locating the buildfile
639@cindex buildfile, locating
640@cindex Makefile, locating
641
642Flymake can be configured to use different tools for performing syntax
643checks. For example, it can use direct compiler call to syntax check a perl
644script or a call to @code{make} for a more complicated case of a
645@code{C/C++} source. The general idea is that simple files, like perl
646scripts and html pages, can be checked by directly invoking a
647corresponding tool. Files that are usually more complex and generally
648used as part of larger projects, might require non-trivial options to
649be passed to the syntax check tool, like include directories for
650C++. The latter files are syntax checked using some build tool, like
651@code{make} or @code{Ant}.
652
653All @code{make} configuration data is usually stored in a file called
654@code{Makefile}. To allow for future extensions, flymake uses a notion of
655buildfile to reference the 'project configuration' file.
656
657Special function, @code{flymake-find-buildfile} is provided for locating buildfiles.
658Searching for a buildfile is done in a manner similar to that of searching
659for possible master files. A customizable variable
660@code{flymake-buildfile-dirs} holds a list of relative paths to the
661buildfile. They are checked sequentially until a buildfile is found. In case
662there's no build file, syntax check is aborted.
663
664Buildfile values are also cached.
665
666@node Starting the syntax check process
667@section Starting the syntax check process
668@cindex Syntax check process
669
670The command line (command name and the list of arguments) for launching a process is returned by the
671initialization function. Flymake then just calls @code{start-process}
672to start an asynchronous process and configures process filter and
673sentinel which is used for processing the output of the syntax check
674tool.
675
676@node Parsing the output
677@section Parsing the output
678@cindex Parsing the output
679
680The output generated by the syntax check tool is parsed in the process
681filter/sentinel using the error message patterns stored in the
682@code{flymake-err-line-patterns} variable. This variable contains a
683list of items of the form @code{(regexp file-idx line-idx
684err-text-idx)}, used to determine whether a particular line is an
685error message and extract file name, line number and error text,
686respectively. Error type (error/warning) is also guessed by matching
687error text with the '@code{^[wW]arning}' pattern. Anything that was not
688classified as a warning is considered an error. Type is then used to
689sort error menu items, which shows error messages first.
690
691Flymake is also able to interpret error message patterns missing err-text-idx
692information. This is done by merely taking the rest of the matched line
693(@code{(substring line (match-end 0))}) as error text. This trick allows
694to make use of a huge collection of error message line patterns from
695@code{compile.el}. All these error patterns are appended to
696the end of @code{flymake-err-line-patterns}.
697
698The error information obtained is saved in a buffer local
699variable. The buffer for which the process output belongs is
700determined from the process-id@w{}->@w{}buffer mapping updated
701after every process launch/exit.
702
703@node Highlighting erroneous lines
704@section Highlighting erroneous lines
705@cindex Erroneous lines, faces
706
707Highlighting is implemented with overlays and happens in the process
708sentinel, after calling the cleanup function. Two customizable faces
176c6903
RS
709are used: @code{flymake-errline} and
710@code{flymake-warnline}. Errors belonging outside the current
4009494e
GM
711buffer are considered to belong to line 1 of the current buffer.
712
713@node Interaction with other modes
714@section Interaction with other modes
715@cindex Interaction with other modes
716@cindex Interaction with compile mode
717
718The only mode flymake currently knows about is @code{compile}.
719
720Flymake can be configured to not start syntax check if it thinks the
721compilation is in progress. The check is made by the
722@code{flymake-compilation-is-running}, which tests the
723@code{compilation-in-progress} variable. The reason why this might be
724useful is saving CPU time in case both syntax check and compilation
725are very CPU intensive. The original reason for adding this feature,
726though, was working around a locking problem with MS Visual C++ compiler.
727
728Flymake also provides an alternative command for starting compilation,
729@code{flymake-compile}:
730
731@lisp
732(defun flymake-compile ()
733 "Kill all flymake syntax checks then start compilation."
734 (interactive)
735 (flymake-stop-all-syntax-checks)
736 (call-interactively 'compile))
737@end lisp
738
739It just kills all the active syntax check processes before calling
740@code{compile}.
741
742@node GNU Free Documentation License
743@appendix GNU Free Documentation License
744@include doclicense.texi
745
746@node Index
747@unnumbered Index
748
749@printindex cp
750
751@bye