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