This manual is for GNU Flymake (version @value{VERSION}, @value{UPDATED}),
which is a universal on-the-fly syntax checker for GNU Emacs.
-Copyright @copyright{} 2004 Free Software Foundation, Inc.
+Copyright @copyright{} 2004, 2005, 2006 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
and with the Back-Cover Texts as in (a) below. A copy of the license
@menu
* Overview of Flymake::
-* Obtaining Flymake::
* Installing Flymake::
* Using Flymake::
* Configuring Flymake::
extended to support new syntax check tools and error message
patterns. @xref{Configuring Flymake}.
-@node Obtaining Flymake
-@chapter Obtaining Flymake
-@cindex Getting Flymake
-
-Release versions of Flymake can be downloaded from
-@* @url{https://sourceforge.net/project/showfiles.php?group_id=77501}.
-You can also try current version available via CVS at @url{https://}.
-
-Flymake's homepage is at @url{http://flymake.sourceforge.net}.
-
@node Installing Flymake
@chapter Installing
@cindex Installing Flymake
@section Customizable variables
@cindex Customizable variables
-This section summarises variables used for Flymake
+This section summarizes variables used for Flymake
configuration.
@table @code
selected. If no match is found, @code{flymake-mode} is switched off.
@item init-function
-@code{init-function} is required to initialise the syntax check,
+@code{init-function} is required to initialize the syntax check,
usually by creating a temporary copy of the buffer contents. The
function must return @code{(list cmd-name arg-list)}. If
@code{init-function} returns null, syntax check is aborted, by
First, we write the @code{init-function}:
@lisp
-(defun flymake-perl-init(buffer)
- (let* ((temp-file (flymake-init-create-temp-buffer-copy
- buffer
- 'flymake-create-temp-inplace))
- (local-file (concat (flymake-build-relative-path
- (file-name-directory
- (buffer-file-name
- (current-buffer)))
- (file-name-directory temp-file))
- (file-name-nondirectory temp-file))))
- (list "perl" (list "-wc " local-file))
- )
-)
+(defun flymake-perl-init (buffer)
+ (let* ((temp-file (flymake-init-create-temp-buffer-copy
+ buffer 'flymake-create-temp-inplace))
+ (local-file (concat (flymake-build-relative-filename
+ (file-name-directory
+ (buffer-file-name
+ (current-buffer)))
+ (file-name-directory temp-file))
+ (file-name-nondirectory temp-file))))
+ (list "perl" (list "-wc " local-file))))
@end lisp
@code{flymake-perl-init} creates a temporary copy of the buffer
@lisp
(setq flymake-allowed-file-name-masks
- (cons '(".+\\.pl$"
- flymake-perl-init
- flymake-simple-cleanup
- flymake-get-real-file-name)
- flymake-allowed-file-name-masks))
+ (cons '(".+\\.pl$"
+ flymake-perl-init
+ flymake-simple-cleanup
+ flymake-get-real-file-name)
+ flymake-allowed-file-name-masks))
@end lisp
Note that we use standard @code{cleanup-function} and
@lisp
(setq flymake-err-line-patterns
- (cons '("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
- flymake-err-line-patterns))
+ (cons '("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]"
+ 2 3 nil 1)
+ flymake-err-line-patterns))
@end lisp
@node Example -- Configuring a tool called via make
@lisp
(setq flymake-allowed-file-name-masks
- (cons '(".+\\.c$"
- flymake-simple-make-init
- flymake-simple-cleanup
- flymake-get-real-file-name)
- flymake-allowed-file-name-masks))
+ (cons '(".+\\.c$"
+ flymake-simple-make-init
+ flymake-simple-cleanup
+ flymake-get-real-file-name)
+ flymake-allowed-file-name-masks))
@end lisp
@code{flymake-simple-make-init} builds the following @code{make}
@lisp
(list "make"
- (list "-s"
- "-C"
- base-dir
- (concat "CHK_SOURCES=" source)
- "SYNTAX_CHECK_MODE=1"
- "check-syntax"))
+ (list "-s" "-C"
+ base-dir
+ (concat "CHK_SOURCES=" source)
+ "SYNTAX_CHECK_MODE=1"
+ "check-syntax"))
@end lisp
@code{base-dir} is a directory containing @code{Makefile}, see @ref{Locating the buildfile}.
Syntax check is considered possible if there's an entry in
@code{flymake-allowed-file-name-masks} matching buffer's filename and
-its @code{init-function} returns non-nil value.
+its @code{init-function} returns non-@code{nil} value.
Two syntax check modes are distinguished:
and the way it can be obtained can vary greatly for different projects.
Therefore, a customizable variable
@code{flymake-get-project-include-dirs-function} is used to provide the
-way to implement the desired behaviour.
+way to implement the desired behavior.
The default implementation, @code{flymake-get-project-include-dirs-imp},
uses a @code{make} call. This requires a correct base directory, that is, a
Flymake can be configured to use different tools for performing syntax
checks. For example, it can use direct compiler call to syntax check a perl
script or a call to @code{make} for a more complicated case of a
-@code{C/C++} source. The general idea is that simple files, like perl
+@code{C/C++} source. The general idea is that simple files, like perl
scripts and html pages, can be checked by directly invoking a
corresponding tool. Files that are usually more complex and generally
used as part of larger projects, might require non-trivial options to
@code{flymake-compile}:
@lisp
-(defun flymake-compile()
- "kill all flymake syntax checks, start compilation"
- (interactive)
- (flymake-stop-all-syntax-checks)
- (call-interactively 'compile)
-)
+(defun flymake-compile ()
+ "Kill all flymake syntax checks then start compilation."
+ (interactive)
+ (flymake-stop-all-syntax-checks)
+ (call-interactively 'compile))
@end lisp
It just kills all the active syntax check processes before calling
@printindex cp
@bye
+
+@ignore
+ arch-tag: 9f0db077-5598-49ab-90b9-8df9248a63ec
+@end ignore