Difference between revisions of "Flymake"
(create page) |
|||
Line 1: | Line 1: | ||
[[Category:Compile]] | [[Category:Compile]] | ||
+ | = Overview = | ||
+ | |||
+ | Flymake is a on-the-fly syntax checker for Emacs. It works by running a | ||
+ | preconfigured syntax check tool in the background, processing the tool's | ||
+ | output and highlighting errors in the current Buffer. The most common | ||
+ | use is to check computer programs for errors, although flymake can be | ||
+ | configured to use any program for checking the contents of a buffer. | ||
+ | |||
+ | The [[Flyspell]] mode provides a similar functionality for spellchecking | ||
+ | a document on the fly. | ||
+ | |||
+ | == Configuration == | ||
+ | |||
+ | This section details how to make flymake work with different | ||
+ | programming languages. | ||
+ | |||
+ | === C === | ||
+ | |||
+ | Using flymake with the C programming language requires some | ||
+ | setup. Flymake expects a [http://www.gnu.org/software/make/ Makefile] in | ||
+ | the current directory. The Makefile is required to have a target named | ||
+ | "check-syntax". Thus a minimal Makefile for getting flymake to work | ||
+ | could look like this: | ||
+ | |||
+ | {{Snippet| | ||
+ | .PHONY: check-syntax | ||
+ | |||
+ | # depending on the compiler, -fsyntax-only has to be | ||
+ | # replaced by another option | ||
+ | |||
+ | check-syntax: | ||
+ | $(CC) -fsyntax-only $(CHK_SOURCES) | ||
+ | }} |
Revision as of 07:11, 1 April 2012
Overview
Flymake is a on-the-fly syntax checker for Emacs. It works by running a preconfigured syntax check tool in the background, processing the tool's output and highlighting errors in the current Buffer. The most common use is to check computer programs for errors, although flymake can be configured to use any program for checking the contents of a buffer.
The Flyspell mode provides a similar functionality for spellchecking a document on the fly.
Configuration
This section details how to make flymake work with different programming languages.
C
Using flymake with the C programming language requires some setup. Flymake expects a Makefile in the current directory. The Makefile is required to have a target named "check-syntax". Thus a minimal Makefile for getting flymake to work could look like this:
.PHONY: check-syntax
# depending on the compiler, -fsyntax-only has to be
# replaced by another option
check-syntax:
$(CC) -fsyntax-only $(CHK_SOURCES)