Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
\input texinfo @c -*-texinfo; coding: utf-8 -*-
|
2007-09-06 05:07:05 +00:00
|
|
|
@comment %**start of header
|
2014-06-10 02:20:31 +00:00
|
|
|
@setfilename ../../info/flymake.info
|
2018-06-05 13:20:42 +00:00
|
|
|
@set VERSION 1.0
|
|
|
|
@set UPDATED June 2018
|
2007-09-06 05:07:05 +00:00
|
|
|
@settitle GNU Flymake @value{VERSION}
|
2018-07-28 07:40:57 +00:00
|
|
|
@include docstyle.texi
|
2007-09-06 05:07:05 +00:00
|
|
|
@syncodeindex pg cp
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@syncodeindex vr cp
|
|
|
|
@syncodeindex fn cp
|
2007-09-06 05:07:05 +00:00
|
|
|
@comment %**end of header
|
|
|
|
|
|
|
|
@copying
|
|
|
|
This manual is for GNU Flymake (version @value{VERSION}, @value{UPDATED}),
|
|
|
|
which is a universal on-the-fly syntax checker for GNU Emacs.
|
|
|
|
|
2020-01-01 00:19:43 +00:00
|
|
|
Copyright @copyright{} 2004--2020 Free Software Foundation, Inc.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@quotation
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
2008-11-19 04:29:29 +00:00
|
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
2007-09-06 05:07:05 +00:00
|
|
|
any later version published by the Free Software Foundation; with no
|
2014-05-07 17:34:53 +00:00
|
|
|
Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
|
2007-09-06 05:07:05 +00:00
|
|
|
and with the Back-Cover Texts as in (a) below. A copy of the license
|
2008-06-15 02:31:43 +00:00
|
|
|
is included in the section entitled ``GNU Free Documentation License''.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2008-06-13 04:20:28 +00:00
|
|
|
(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
|
2012-12-21 18:36:41 +00:00
|
|
|
modify this GNU manual.''
|
2007-09-06 05:07:05 +00:00
|
|
|
@end quotation
|
|
|
|
@end copying
|
|
|
|
|
2011-02-18 13:57:53 +00:00
|
|
|
@dircategory Emacs misc features
|
2007-09-06 05:07:05 +00:00
|
|
|
@direntry
|
Minor doc/misc/*.texi direntry fixes.
* ada-mode.texi, auth.texi, autotype.texi, calc.texi, cc-mode.texi:
* dired-x.texi, ebrowse.texi, ede.texi, edt.texi, eieio.texi:
* emacs-mime.texi, epa.texi, erc.texi, eshell.texi, eudc.texi:
* flymake.texi, gnus.texi, info.texi, mairix-el.texi, message.texi:
* newsticker.texi, org.texi, pgg.texi, rcirc.texi, reftex.texi:
* remember.texi, sasl.texi, semantic.texi, ses.texi, smtpmail.texi:
* speedbar.texi, tramp.texi, url.texi, viper.texi, widget.texi:
* woman.texi:
Start direntry descriptions in column 32, per Texinfo convention.
Make them end with a period.
2010-06-24 07:10:51 +00:00
|
|
|
* Flymake: (flymake). A universal on-the-fly syntax checker.
|
2007-09-06 05:07:05 +00:00
|
|
|
@end direntry
|
|
|
|
|
|
|
|
@titlepage
|
|
|
|
@title GNU Flymake
|
|
|
|
@subtitle for version @value{VERSION}, @value{UPDATED}
|
2018-06-05 13:20:42 +00:00
|
|
|
@author João Távora and Pavel Kobiakov(@email{pk_at_work@@yahoo.com}).
|
2007-09-06 05:07:05 +00:00
|
|
|
@page
|
|
|
|
@vskip 0pt plus 1filll
|
|
|
|
@insertcopying
|
|
|
|
@end titlepage
|
|
|
|
|
|
|
|
@contents
|
|
|
|
|
|
|
|
@ifnottex
|
|
|
|
@node Top
|
|
|
|
@top GNU Flymake
|
2012-12-05 22:27:56 +00:00
|
|
|
@insertcopying
|
2007-09-06 05:07:05 +00:00
|
|
|
@end ifnottex
|
|
|
|
|
|
|
|
@menu
|
|
|
|
* Using Flymake::
|
2017-09-27 17:42:02 +00:00
|
|
|
* Extending Flymake::
|
|
|
|
* The legacy Proc backend::
|
2007-09-06 05:07:05 +00:00
|
|
|
* GNU Free Documentation License::
|
|
|
|
* Index::
|
|
|
|
@end menu
|
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
@node Using Flymake
|
|
|
|
@chapter Using Flymake
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex overview of flymake
|
2017-10-12 11:11:26 +00:00
|
|
|
@cindex using flymake
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
Flymake is a universal on-the-fly buffer checker implemented as an
|
2017-10-28 23:42:23 +00:00
|
|
|
Emacs minor mode. To use Flymake, you must first activate
|
2017-10-12 11:11:26 +00:00
|
|
|
@code{flymake-mode} by using the command @kbd{flymake-mode}.
|
2017-09-27 17:42:02 +00:00
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
When enabled, Flymake collects information about problems in the
|
|
|
|
buffer, called @dfn{diagnostics}, from one or more different sources,
|
|
|
|
or @dfn{backends}, and then visually annotates the buffer by
|
|
|
|
highlighting problematic buffer regions with a special face.
|
2017-09-27 17:42:02 +00:00
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
It also displays an overall buffer status in the mode line containing
|
|
|
|
totals for different types of diagnostics.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2014-01-13 15:22:47 +00:00
|
|
|
Syntax check is done ``on-the-fly''. It is started whenever
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@itemize @bullet
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
@code{flymake-mode} is started, unless
|
2017-10-12 11:11:26 +00:00
|
|
|
@code{flymake-start-on-flymake-mode} is nil;
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2018-06-08 21:30:46 +00:00
|
|
|
@item
|
|
|
|
the buffer is saved, unless @code{flymake-start-on-save-buffer} is
|
|
|
|
nil;
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
some changes were made to the buffer more than @code{0.5} seconds ago
|
|
|
|
(the delay is configurable in @code{flymake-no-changes-timeout}).
|
2007-09-06 05:07:05 +00:00
|
|
|
@end itemize
|
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
Syntax check can also be started manually by typing the @kbd{M-x
|
|
|
|
flymake-start @key{RET}} command.
|
|
|
|
|
2018-06-25 11:27:56 +00:00
|
|
|
If the check detected errors or warnings, the respective buffer
|
|
|
|
regions are highlighted. You can place point on those regions and use
|
|
|
|
@kbd{C-h .} (@code{display-local-help}) to see what the specific
|
|
|
|
problem was. Alternatively, hovering the mouse on those regions
|
|
|
|
should also display a tool-tip with the same information.
|
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} are
|
|
|
|
commands that allow easy navigation to the next/previous erroneous
|
2018-06-25 11:27:56 +00:00
|
|
|
regions, respectively. If might be a good idea to map them to @kbd{M-n}
|
2017-10-12 11:11:26 +00:00
|
|
|
and @kbd{M-p} in @code{flymake-mode}, by adding to your init file:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(define-key flymake-mode-map (kbd "M-n") 'flymake-goto-next-error)
|
|
|
|
(define-key flymake-mode-map (kbd "M-p") 'flymake-goto-prev-error)
|
|
|
|
@end lisp
|
|
|
|
|
2007-09-06 05:07:05 +00:00
|
|
|
Flymake is a universal syntax checker in the sense that it's easily
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
extended to support new backends (@pxref{Extending Flymake}).
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
Historically, Flymake used to accept diagnostics from a single
|
|
|
|
backend, albeit a reasonably flexible one.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
This backend isn't (yet) obsolete, and so is still available as a
|
|
|
|
fallback and active by default (@pxref{The legacy Proc backend}). It works by
|
2017-10-10 01:14:46 +00:00
|
|
|
selecting a syntax check tool from a preconfigured list (compiler for
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
C@t{++} files, @command{perl} for Perl files, etc.), and executing it in the
|
2017-10-10 01:14:46 +00:00
|
|
|
background, passing it a temporary file which is a copy of the current
|
|
|
|
buffer, and parsing the output for known error/warning message
|
|
|
|
patterns.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@menu
|
|
|
|
* Syntax check statuses::
|
2017-10-10 01:14:46 +00:00
|
|
|
* Backend exceptions::
|
2017-09-27 17:42:02 +00:00
|
|
|
* Customizable variables::
|
2007-09-06 05:07:05 +00:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Syntax check statuses
|
|
|
|
@section Syntax check statuses
|
|
|
|
@cindex Syntax check statuses
|
|
|
|
|
2017-10-12 11:11:26 +00:00
|
|
|
When enabled, Flymake displays its status in the mode line, which
|
|
|
|
provides a visual summary of diagnostic collection. It may also hint
|
|
|
|
at certain exceptional situations encountered when communicating with
|
|
|
|
backends.
|
|
|
|
|
2017-10-06 13:08:49 +00:00
|
|
|
The following statuses are defined:
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@multitable @columnfractions 0.25 0.75
|
2017-10-12 11:11:26 +00:00
|
|
|
@item [@var{nerrors} @var{nwarnings} ...]
|
|
|
|
@tab Normal operation. @var{nerrors} and @var{nwarnings} are, respectively,
|
|
|
|
the total number of errors and warnings found during the last buffer
|
|
|
|
check, for all backends. They may be followed by other totals for
|
|
|
|
other types of diagnostics (@pxref{Flymake error types}).
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@item @code{Wait}
|
2017-10-12 11:11:26 +00:00
|
|
|
@tab Some Flymake backends haven't reported since the last time they
|
|
|
|
where questioned. It is reasonable to assume that this is a temporary
|
|
|
|
delay and Flymake will resume normal operation soon.
|
2017-09-27 17:42:02 +00:00
|
|
|
|
|
|
|
@item @code{!}
|
2017-10-12 11:11:26 +00:00
|
|
|
@tab All the configured Flymake backends have disabled themselves: Flymake
|
|
|
|
cannot annotate the buffer and action from the user is needed to
|
|
|
|
investigate and remedy the situation (@pxref{Backend exceptions}).
|
2017-09-27 17:42:02 +00:00
|
|
|
|
|
|
|
@item @code{?}
|
2017-10-12 11:11:26 +00:00
|
|
|
@tab There are no applicable Flymake backends for this buffer, thus Flymake
|
|
|
|
cannot annotate it. To fix this, a user may look to extending Flymake
|
|
|
|
and add a new backend (@pxref{Extending Flymake}).
|
2017-09-27 17:42:02 +00:00
|
|
|
|
2007-09-06 05:07:05 +00:00
|
|
|
@end multitable
|
|
|
|
|
2017-10-10 01:14:46 +00:00
|
|
|
@node Backend exceptions
|
|
|
|
@section Backend exceptions
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex backend exceptions
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex disabled backends
|
|
|
|
@cindex backends, disabled
|
2017-10-10 01:14:46 +00:00
|
|
|
Some backends may take longer than others to respond or complete, and
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
some may decide to @emph{disable} themselves if they are not suitable
|
2017-10-12 11:11:26 +00:00
|
|
|
for the current buffer or encounter some unavoidable problem. A
|
|
|
|
disabled backend is not tried again for future checks of the current
|
|
|
|
buffer.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@findex flymake-reporting-backends
|
|
|
|
@findex flymake-running-backends
|
|
|
|
@findex flymake-disabled-backends
|
2017-10-10 01:14:46 +00:00
|
|
|
The commands @code{flymake-reporting-backends},
|
|
|
|
@code{flymake-running-backends} and @code{flymake-disabled-backends}
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
show the backends currently used and those which are disabled.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex reset disabled backends
|
|
|
|
Toggling @code{flymake-mode} off and on again, or invoking
|
2017-10-10 01:14:46 +00:00
|
|
|
@code{flymake-start} with a prefix argument is one way to reset the
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
disabled backend list, so that they will be tried again in the next check.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex logging
|
|
|
|
@cindex flymake logging
|
2017-10-12 11:11:26 +00:00
|
|
|
Flymake also uses a simple logging facility for indicating important
|
|
|
|
points in the control flow. The logging facility sends logging
|
|
|
|
messages to the @file{*Flymake log*} buffer. The information logged
|
|
|
|
can be used for resolving various problems related to Flymake. For
|
|
|
|
convenience, a shortcut to this buffer can be found in Flymake's menu,
|
|
|
|
accessible from the top menu bar or just left of the status indicator.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@vindex warning-minimum-log-level
|
|
|
|
@vindex warning-minimum-level
|
2017-09-27 17:42:02 +00:00
|
|
|
Logging output is controlled by the Emacs @code{warning-minimum-log-level}
|
|
|
|
and @code{warning-minimum-level} variables.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@node Customizable variables
|
|
|
|
@section Customizable variables
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex customizable variables
|
|
|
|
@cindex variables for customizing flymake
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-10-10 01:14:46 +00:00
|
|
|
This section summarizes customization variables used for the
|
|
|
|
configuration of the Flymake user interface.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@vtable @code
|
2007-09-06 05:07:05 +00:00
|
|
|
@item flymake-no-changes-timeout
|
|
|
|
If any changes are made to the buffer, syntax check is automatically
|
2017-10-10 01:14:46 +00:00
|
|
|
started after this many seconds, unless the user makes another change,
|
|
|
|
which resets the timer.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-10-10 01:14:46 +00:00
|
|
|
@item flymake-start-on-flymake-mode
|
|
|
|
A boolean flag indicating whether to start syntax check immediately
|
|
|
|
after enabling @code{flymake-mode}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2018-06-08 21:30:46 +00:00
|
|
|
@item flymake-start-on-save-buffer
|
|
|
|
A boolean flag indicating whether to start syntax check after saving
|
|
|
|
the buffer.
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@item flymake-error
|
|
|
|
A custom face for highlighting regions for which an error has been
|
|
|
|
reported.
|
|
|
|
|
|
|
|
@item flymake-warning
|
|
|
|
A custom face for highlighting regions for which a warning has been
|
|
|
|
reported.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@item flymake-note
|
|
|
|
A custom face for highlighting regions for which a note has been
|
|
|
|
reported.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2012-11-12 08:42:27 +00:00
|
|
|
@item flymake-error-bitmap
|
|
|
|
A bitmap used in the fringe to mark lines for which an error has
|
|
|
|
been reported.
|
|
|
|
|
|
|
|
@item flymake-warning-bitmap
|
|
|
|
A bitmap used in the fringe to mark lines for which a warning has
|
|
|
|
been reported.
|
|
|
|
|
|
|
|
@item flymake-fringe-indicator-position
|
|
|
|
Which fringe (if any) should show the warning/error bitmaps.
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@item flymake-wrap-around
|
|
|
|
If non-nil, moving to errors with @code{flymake-goto-next-error} and
|
|
|
|
@code{flymake-goto-prev-error} wraps around buffer boundaries.
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@end vtable
|
2017-09-27 17:42:02 +00:00
|
|
|
|
|
|
|
@node Extending Flymake
|
|
|
|
@chapter Extending Flymake
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex extending flymake
|
2017-09-27 17:42:02 +00:00
|
|
|
|
2017-10-10 01:14:46 +00:00
|
|
|
Flymake can primarily be extended in one of two ways:
|
|
|
|
|
|
|
|
@enumerate
|
|
|
|
@item
|
|
|
|
By changing the look and feel of the annotations produced by the
|
|
|
|
different backends.
|
|
|
|
|
|
|
|
@item
|
|
|
|
By adding a new buffer-checking backend.
|
|
|
|
@end enumerate
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
The following sections discuss each approach in detail.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
@menu
|
|
|
|
* Flymake error types::
|
|
|
|
* Backend functions::
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Flymake error types
|
|
|
|
@section Customizing Flymake error types
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex customizing error types
|
|
|
|
@cindex error types, customization
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2018-06-05 14:13:02 +00:00
|
|
|
To customize the appearance of error types, set properties on the
|
|
|
|
symbols associated with each diagnostic type. The standard diagnostic
|
|
|
|
symbols are @code{:error}, @code{:warning} and @code{:note} (though
|
|
|
|
the backend may define more, @pxref{Backend functions}).
|
|
|
|
|
|
|
|
The following properties can be set:
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
@itemize
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
@cindex bitmap of diagnostic
|
2018-06-05 14:13:02 +00:00
|
|
|
@code{flymake-bitmap}, an image displayed in the fringe according to
|
2017-10-10 01:14:46 +00:00
|
|
|
@code{flymake-fringe-indicator-position}. The value actually follows
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
the syntax of @code{flymake-error-bitmap} (@pxref{Customizable
|
2017-10-10 01:14:46 +00:00
|
|
|
variables}). It is overridden by any @code{before-string} overlay
|
|
|
|
property.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
2018-06-05 14:13:02 +00:00
|
|
|
@code{flymake-overlay-control}, an alist ((@var{OVPROP} . @var{VALUE})
|
|
|
|
@var{...}) of further properties used to affect the appearance of
|
|
|
|
Flymake annotations. With the exception of @code{category} and
|
|
|
|
@code{evaporate}, these properties are applied directly to the created
|
|
|
|
overlay (@pxref{Overlay Properties,,, elisp, The Emacs Lisp Reference
|
|
|
|
Manual}).
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2018-06-05 14:13:02 +00:00
|
|
|
As an example, here's how to make diagnostics of the type @code{:note}
|
|
|
|
stand out more prominently:
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2018-06-05 14:13:02 +00:00
|
|
|
@example
|
|
|
|
(push '(face . highlight) (get :note 'flymake-overlay-control))
|
|
|
|
@end example
|
|
|
|
|
|
|
|
If you push another alist entry in front, it overrides the previous
|
|
|
|
one. So this effectively removes the face from @code{:note}
|
|
|
|
diagnostics:
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
@example
|
2018-06-05 14:13:02 +00:00
|
|
|
(push '(face . nil) (get :note 'flymake-overlay-control))
|
2017-10-10 01:14:46 +00:00
|
|
|
@end example
|
|
|
|
|
2018-06-05 14:13:02 +00:00
|
|
|
To restore the original look for @code{:note} types, empty or remove
|
|
|
|
its @code{flymake-overlay-control} property:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(put :note 'flymake-overlay-control '())
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@item
|
|
|
|
@cindex severity of diagnostic
|
|
|
|
@code{flymake-severity} is a non-negative integer specifying the
|
|
|
|
diagnostic's severity. The higher the value, the more serious is the
|
|
|
|
error. If the overlay property @code{priority} is not specified in
|
|
|
|
@code{flymake-overlay-control}, @code{flymake-severity} is used to set
|
|
|
|
it and help sort overlapping overlays.
|
|
|
|
|
2019-11-02 16:38:53 +00:00
|
|
|
@item
|
|
|
|
@vindex flymake-type-name
|
|
|
|
@code{flymake-type-name} is a string used to succinctly name the error
|
|
|
|
type, in case the name of the symbol associated with it is very long.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
@vindex flymake-category
|
|
|
|
@code{flymake-category} is a symbol whose property list is considered
|
|
|
|
the default for missing values of any other properties.
|
2017-10-10 01:14:46 +00:00
|
|
|
@end itemize
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex predefined diagnostic types
|
|
|
|
@vindex flymake-error
|
|
|
|
@vindex flymake-warning
|
|
|
|
@vindex flymake-note
|
2018-06-05 14:13:02 +00:00
|
|
|
Three default diagnostic types are predefined: @code{:error},
|
|
|
|
@code{:warning}, and @code{:note}. By default, each one of them has a
|
2017-10-10 01:14:46 +00:00
|
|
|
@code{flymake-category} property whose value is, respectively, the
|
2018-06-05 14:13:02 +00:00
|
|
|
category symbol @code{flymake-error}, @code{flymake-warning} and
|
2017-10-10 01:14:46 +00:00
|
|
|
@code{flymake-note}.
|
|
|
|
|
2018-06-05 14:13:02 +00:00
|
|
|
These category symbols' plist is where the values of customizable
|
|
|
|
variables and faces (such as @code{flymake-error-bitmap}) are found.
|
|
|
|
Thus, if you change their plists, Flymake may stop honoring these user
|
|
|
|
customizations.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2018-06-05 14:13:02 +00:00
|
|
|
The @code{flymake-category} special property is especially useful for
|
|
|
|
backends which create diagnostics objects with non-default types that
|
|
|
|
differ from an existing type by only a few properties (@pxref{Flymake
|
|
|
|
utility functions}).
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
As an example, consider configuring a new diagnostic type
|
2018-06-05 14:13:02 +00:00
|
|
|
@code{:low-priority-note} that behaves much like @code{:note}, but
|
|
|
|
without an overlay face.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
@example
|
2018-06-05 14:13:02 +00:00
|
|
|
(put :low-priority-note 'flymake-overlay-control '((face . nil)))
|
|
|
|
(put :low-priority-note 'flymake-category 'flymake-note)
|
2017-10-10 01:14:46 +00:00
|
|
|
@end example
|
|
|
|
|
2017-10-19 11:33:20 +00:00
|
|
|
@vindex flymake-diagnostics
|
|
|
|
@vindex flymake-diagnostic-backend
|
|
|
|
@vindex flymake-diagnostic-buffer
|
|
|
|
@vindex flymake-diagnostic-text
|
|
|
|
@vindex flymake-diagnostic-beg
|
|
|
|
@vindex flymake-diagnostic-end
|
2017-10-10 01:14:46 +00:00
|
|
|
As you might have guessed, Flymake's annotations are implemented as
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
overlays (@pxref{Overlays,,, elisp, The Emacs Lisp Reference Manual}).
|
2017-10-10 01:14:46 +00:00
|
|
|
Along with the properties that you specify for the specific type of
|
2017-10-19 11:33:20 +00:00
|
|
|
diagnostic, Flymake adds the property @code{flymake-diagnostic} to
|
|
|
|
these overlays, and sets it to the object that the backend created
|
|
|
|
with @code{flymake-make-diagnostic}.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2017-10-19 11:33:20 +00:00
|
|
|
Since overlays also support arbitrary keymaps, you can use this along
|
|
|
|
with the functions @code{flymake-diagnostics} and
|
|
|
|
@code{flymake-diagnostic-text} (@pxref{Flymake utility functions}) to
|
|
|
|
create interactive annotations, such as in the following example of
|
|
|
|
binding a @code{mouse-3} event (middle mouse button click) to an
|
|
|
|
Internet search for the text of a @code{:warning} or @code{:error}.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
@example
|
|
|
|
(defun my-search-for-message (event)
|
|
|
|
(interactive "e")
|
2017-10-19 11:33:20 +00:00
|
|
|
(let* ((diags (flymake-diagnostics (posn-point (event-start event))))
|
|
|
|
(topmost-diag (car diags)))
|
|
|
|
(eww-browse-url
|
|
|
|
(concat
|
|
|
|
"https://duckduckgo.com/?q="
|
2018-06-05 14:13:02 +00:00
|
|
|
(replace-regexp-in-string
|
|
|
|
" " "+" (flymake-diagnostic-text topmost-diag)))
|
2017-10-19 11:33:20 +00:00
|
|
|
t)))
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
(dolist (type '(:warning :error))
|
2018-06-05 14:13:02 +00:00
|
|
|
(push '(mouse-face . highlight) (get type 'flymake-overlay-control))
|
|
|
|
(push `(keymap . ,(let ((map (make-sparse-keymap)))
|
|
|
|
(define-key map [mouse-2]
|
|
|
|
'my-search-for-message)
|
|
|
|
map))
|
|
|
|
(get type 'flymake-overlay-control)))
|
2017-10-10 01:14:46 +00:00
|
|
|
@end example
|
|
|
|
|
|
|
|
@node Backend functions
|
|
|
|
@section Backend functions
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex backend functions
|
2017-10-10 01:14:46 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@vindex flymake-diagnostic-functions
|
2017-10-10 01:14:46 +00:00
|
|
|
Flymake backends are Lisp functions placed in the special hook
|
|
|
|
@code{flymake-diagnostic-functions}.
|
|
|
|
|
|
|
|
A backend's responsibility is to diagnose the contents of a buffer for
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
problems, registering the problem's positions, type, and summary
|
|
|
|
description. This information is collected in the form of diagnostic
|
|
|
|
objects created by the function @code{flymake-make-diagnostic}
|
|
|
|
(@pxref{Flymake utility functions}), and
|
|
|
|
then handed over to Flymake, which proceeds to annotate the
|
2017-10-10 01:14:46 +00:00
|
|
|
buffer.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
A request for a buffer check, and the subsequent delivery of
|
|
|
|
diagnostics, are two key events of the interaction between Flymake
|
|
|
|
and backend. Each such event corresponds to a well-defined function
|
2017-10-10 01:14:46 +00:00
|
|
|
calling convention: one for calls made by Flymake into the backend via
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
the backend function, the other in the reverse direction via a
|
|
|
|
callback. To be usable, backends must adhere to both.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
2018-06-15 11:17:37 +00:00
|
|
|
The first argument passed to a backend function is always
|
|
|
|
@var{report-fn}, a callback function detailed below. Beyond it,
|
|
|
|
functions must be prepared to accept (and possibly ignore) an
|
|
|
|
arbitrary number of keyword-value pairs of the form
|
|
|
|
@w{@code{(@var{:key} @var{value} @var{:key2} @var{value2}...)}}.
|
|
|
|
|
|
|
|
Currently, Flymake may pass the following keywords and values to the
|
|
|
|
backend function:
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
@itemize
|
|
|
|
|
2018-06-15 11:17:37 +00:00
|
|
|
@item @code{:recent-changes}
|
|
|
|
The value is a list recent changes since the last time the backend
|
|
|
|
function was called for the buffer. If the list is empty, this
|
|
|
|
indicates that no changes have been recorded. If it is the first time
|
|
|
|
that this backend function is called for this activation of
|
|
|
|
@code{flymake-mode}, then this argument isn't provided at all
|
|
|
|
(i.e. it's not merely nil).
|
|
|
|
|
|
|
|
Each element is in the form (@var{beg} @var{end} @var{text}) where
|
|
|
|
@var{beg} and @var{end} are buffer positions, and @var{text} is a
|
|
|
|
string containing the text contained between those positions (if any),
|
|
|
|
after the change was performed.
|
|
|
|
|
|
|
|
@item @code{:changes-start} and @code{:changes-end}
|
|
|
|
The value is, repectively, the minimum and maximum buffer positions
|
|
|
|
touched by the recent changes. These are provided for convenience and
|
|
|
|
only if @code{:recent-changes} is also provided.
|
|
|
|
|
2017-10-10 01:14:46 +00:00
|
|
|
@end itemize
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
Whenever Flymake or the user decide to re-check the buffer, backend
|
|
|
|
functions are called as detailed above, and are expected to initiate
|
2017-10-10 01:14:46 +00:00
|
|
|
this check, but aren't in any way required to complete it before
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
exiting: if the computation involved is expensive, as
|
|
|
|
is often the case with large buffers, that slower task should be
|
|
|
|
scheduled for the future using asynchronous sub-processes
|
|
|
|
(@pxref{Asynchronous Processes,,, elisp, The Emacs Lisp reference
|
|
|
|
manual}) or other asynchronous mechanisms.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
In any case, backend functions are expected to return quickly or
|
|
|
|
signal an error, in which case the backend is disabled
|
|
|
|
(@pxref{Backend exceptions}).
|
|
|
|
|
|
|
|
If the function returns, Flymake considers the backend to be
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@dfn{running}. If it has not done so already, the backend is expected
|
2017-10-10 01:14:46 +00:00
|
|
|
to call the function @var{report-fn} passed to it, at which point
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
Flymake considers the backend to be @dfn{reporting}. Backends call
|
2017-10-10 01:14:46 +00:00
|
|
|
@var{report-fn} by passing it a single argument @var{report-action}
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
followed by an optional list of keyword-value pairs of the form
|
|
|
|
@w{@code{(@var{:report-key} @var{value} @var{:report-key2} @var{value2}...)}}.
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
Currently accepted values for @var{report-action} are:
|
|
|
|
|
|
|
|
@itemize
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
A (possibly empty) list of diagnostic objects created by
|
2017-10-10 01:14:46 +00:00
|
|
|
@code{flymake-make-diagnostic}, causing Flymake to annotate the
|
|
|
|
buffer with this information.
|
|
|
|
|
|
|
|
A backend may call @var{report-fn} repeatedly in this manner, but only
|
|
|
|
until Flymake considers that the most recently requested buffer check
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
is now obsolete, because, say, buffer contents have changed in the
|
|
|
|
meantime. The backend is only given notice of this via a renewed call
|
|
|
|
to the backend function. Thus, to prevent making obsolete reports and
|
2017-10-10 01:14:46 +00:00
|
|
|
wasting resources, backend functions should first cancel any ongoing
|
|
|
|
processing from previous calls.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
The symbol @code{:panic}, signaling that the backend has encountered
|
2017-10-10 01:14:46 +00:00
|
|
|
an exceptional situation and should be disabled.
|
|
|
|
@end itemize
|
|
|
|
|
|
|
|
Currently accepted @var{report-key} arguments are:
|
|
|
|
|
|
|
|
@itemize
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
@code{:explanation}, whose value should give user-readable
|
2017-10-10 01:14:46 +00:00
|
|
|
details of the situation encountered, if any.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
@code{:force}, whose value should be a boolean suggesting
|
2017-10-10 01:14:46 +00:00
|
|
|
that Flymake consider the report even if it was somehow
|
|
|
|
unexpected.
|
2018-06-15 11:17:37 +00:00
|
|
|
|
|
|
|
@item
|
|
|
|
@code{:region}, a cons (@var{beg} . @var{end}) of buffer positions
|
|
|
|
indicating that the report applies to that region and that previous
|
|
|
|
reports targeting other parts of the buffer remain valid.
|
2017-10-10 01:14:46 +00:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
@menu
|
|
|
|
* Flymake utility functions::
|
|
|
|
* An annotated example backend::
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Flymake utility functions
|
|
|
|
@subsection Flymake utility functions
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex utility functions
|
2017-10-10 01:14:46 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex create diagnostic object
|
2017-10-10 01:14:46 +00:00
|
|
|
Before delivering them to Flymake, backends create diagnostic objects
|
|
|
|
by calling the function @code{flymake-make-diagnostic}.
|
|
|
|
|
|
|
|
@deffn Function flymake-make-diagnostic buffer beg end type text
|
|
|
|
Make a Flymake diagnostic for @var{buffer}'s region from @var{beg} to
|
2018-06-05 14:13:02 +00:00
|
|
|
@var{end}. @var{type} is a diagnostic symbol (@pxref{Flymake error
|
|
|
|
types}), and @var{text} is a description of the problem detected in
|
2019-12-10 02:44:35 +00:00
|
|
|
this region. Currently, it is unspecified behavior to make
|
2019-11-02 15:53:45 +00:00
|
|
|
diagnostics for buffers other than the buffer that the Flymake backend
|
|
|
|
is responsible for.
|
2017-10-10 01:14:46 +00:00
|
|
|
@end deffn
|
|
|
|
|
2017-10-19 11:33:20 +00:00
|
|
|
@cindex access diagnostic object
|
|
|
|
These objects' properties can be accessed with the functions
|
|
|
|
@code{flymake-diagnostic-backend}, @code{flymake-diagnostic-buffer},
|
|
|
|
@code{flymake-diagnostic-text}, @code{flymake-diagnostic-beg},
|
|
|
|
@code{flymake-diagnostic-end} and @code{flymake-diagnostic-type}.
|
|
|
|
|
|
|
|
Additionally, the function @code{flymake-diagnostics} will collect
|
|
|
|
such objects in the region you specify.
|
|
|
|
|
|
|
|
@cindex collect diagnostic objects
|
|
|
|
@deffn Function flymake-diagnostics beg end
|
|
|
|
Get a list of Flymake diagnostics in the region determined by
|
|
|
|
@var{beg} and @var{end}. If neither @var{beg} or @var{end} is
|
|
|
|
supplied, use the whole buffer, otherwise if @var{beg} is
|
|
|
|
non-@code{nil} and @var{end} is @code{nil}, consider only diagnostics
|
|
|
|
at @var{beg}.
|
|
|
|
@end deffn
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex buffer position from line and column number
|
2017-10-10 01:14:46 +00:00
|
|
|
It is often the case with external syntax tools that a diagnostic's
|
|
|
|
position is reported in terms of a line number, and sometimes a column
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
number. To convert this information into a buffer position, backends
|
2017-10-10 01:14:46 +00:00
|
|
|
can use the following function:
|
|
|
|
|
|
|
|
@deffn Function flymake-diag-region buffer line &optional col
|
2017-10-19 11:33:20 +00:00
|
|
|
Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding
|
|
|
|
to @var{line} and @var{col}. If @var{col} is @code{nil}, return a
|
|
|
|
region just for @var{line}. Return @code{nil} if the region is
|
|
|
|
invalid.
|
2017-10-10 01:14:46 +00:00
|
|
|
@end deffn
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex add a log message
|
2017-10-10 01:14:46 +00:00
|
|
|
For troubleshooting purposes, backends may record arbitrary
|
|
|
|
exceptional or erroneous situations into the Flymake log
|
|
|
|
buffer (@pxref{Backend exceptions}):
|
|
|
|
|
|
|
|
@deffn Macro flymake-log level msg &optional args
|
|
|
|
Log, at level @var{level}, the message @var{msg} formatted with
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@var{args}. @var{level} is passed to @code{display-warning}
|
|
|
|
(@pxref{Warning Basics,,, elisp, The Emacs Lisp reference Manual}), which is
|
2017-10-10 01:14:46 +00:00
|
|
|
used to display the warning in Flymake's log buffer.
|
|
|
|
@end deffn
|
|
|
|
|
|
|
|
@node An annotated example backend
|
|
|
|
@subsection An annotated example backend
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex example of backend
|
|
|
|
@cindex backend, annotated example
|
2017-10-10 01:14:46 +00:00
|
|
|
|
|
|
|
This section presents an annotated example of a complete working
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
Flymake backend. The example illustrates the process of writing a
|
2017-10-10 01:14:46 +00:00
|
|
|
backend as outlined above.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
The backend in question is used for checking Ruby source files. It
|
|
|
|
uses asynchronous sub-processes (@pxref{Asynchronous Processes,,, elisp,
|
2017-10-10 01:14:46 +00:00
|
|
|
The Emacs Lisp Reference Manual}), a common technique for performing
|
|
|
|
parallel processing in Emacs.
|
|
|
|
|
|
|
|
The following code needs lexical binding (@pxref{Using Lexical
|
|
|
|
Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
|
|
|
|
|
|
|
|
@example
|
|
|
|
;;; ruby-flymake.el --- A ruby Flymake backend -*- lexical-binding: t; -*-
|
|
|
|
(defvar-local ruby--flymake-proc nil)
|
|
|
|
|
|
|
|
(defun ruby-flymake (report-fn &rest _args)
|
|
|
|
;; Not having a ruby interpreter is a serious problem which should cause
|
2017-10-19 01:43:00 +00:00
|
|
|
;; the backend to disable itself, so an @code{error} is signaled.
|
2017-10-10 01:14:46 +00:00
|
|
|
;;
|
|
|
|
(unless (executable-find
|
|
|
|
"ruby") (error "Cannot find a suitable ruby"))
|
|
|
|
;; If a live process launched in an earlier check was found, that
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; process is killed. When that process's sentinel eventually runs,
|
|
|
|
;; it will notice its obsoletion, since it have since reset
|
2017-10-10 01:14:46 +00:00
|
|
|
;; `ruby-flymake-proc' to a different value
|
|
|
|
;;
|
|
|
|
(when (process-live-p ruby--flymake-proc)
|
|
|
|
(kill-process ruby--flymake-proc))
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; Save the current buffer, the narrowing restriction, remove any
|
|
|
|
;; narrowing restriction.
|
2017-10-10 01:14:46 +00:00
|
|
|
;;
|
|
|
|
(let ((source (current-buffer)))
|
|
|
|
(save-restriction
|
|
|
|
(widen)
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; Reset the `ruby--flymake-proc' process to a new process
|
|
|
|
;; calling the ruby tool.
|
2017-10-10 01:14:46 +00:00
|
|
|
;;
|
|
|
|
(setq
|
|
|
|
ruby--flymake-proc
|
|
|
|
(make-process
|
|
|
|
:name "ruby-flymake" :noquery t :connection-type 'pipe
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; Make output go to a temporary buffer.
|
2017-10-10 01:14:46 +00:00
|
|
|
;;
|
|
|
|
:buffer (generate-new-buffer " *ruby-flymake*")
|
|
|
|
:command '("ruby" "-w" "-c")
|
|
|
|
:sentinel
|
|
|
|
(lambda (proc _event)
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; Check that the process has indeed exited, as it might
|
|
|
|
;; be simply suspended.
|
2017-10-10 01:14:46 +00:00
|
|
|
;;
|
|
|
|
(when (eq 'exit (process-status proc))
|
|
|
|
(unwind-protect
|
|
|
|
;; Only proceed if `proc' is the same as
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; `ruby--flymake-proc', which indicates that
|
2017-10-10 01:14:46 +00:00
|
|
|
;; `proc' is not an obsolete process.
|
|
|
|
;;
|
2017-10-19 23:50:34 +00:00
|
|
|
(if (with-current-buffer source (eq proc ruby--flymake-proc))
|
2017-10-10 01:14:46 +00:00
|
|
|
(with-current-buffer (process-buffer proc)
|
|
|
|
(goto-char (point-min))
|
|
|
|
;; Parse the output buffer for diagnostic's
|
|
|
|
;; messages and locations, collect them in a list
|
|
|
|
;; of objects, and call `report-fn'.
|
|
|
|
;;
|
|
|
|
(cl-loop
|
|
|
|
while (search-forward-regexp
|
|
|
|
"^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
|
|
|
|
nil t)
|
|
|
|
for msg = (match-string 2)
|
|
|
|
for (beg . end) = (flymake-diag-region
|
|
|
|
source
|
|
|
|
(string-to-number (match-string 1)))
|
|
|
|
for type = (if (string-match "^warning" msg)
|
|
|
|
:warning
|
|
|
|
:error)
|
|
|
|
collect (flymake-make-diagnostic source
|
|
|
|
beg
|
|
|
|
end
|
|
|
|
type
|
|
|
|
msg)
|
|
|
|
into diags
|
|
|
|
finally (funcall report-fn diags)))
|
2020-07-11 10:13:54 +00:00
|
|
|
(flymake-log :warning "Cancelling obsolete check %s"
|
2017-10-10 01:14:46 +00:00
|
|
|
proc))
|
|
|
|
;; Cleanup the temporary buffer used to hold the
|
|
|
|
;; check's output.
|
|
|
|
;;
|
|
|
|
(kill-buffer (process-buffer proc)))))))
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
;; Send the buffer contents to the process's stdin, followed by
|
|
|
|
;; an EOF.
|
2017-10-10 01:14:46 +00:00
|
|
|
;;
|
|
|
|
(process-send-region ruby--flymake-proc (point-min) (point-max))
|
|
|
|
(process-send-eof ruby--flymake-proc))))
|
|
|
|
|
|
|
|
(defun ruby-setup-flymake-backend ()
|
|
|
|
(add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t))
|
|
|
|
|
|
|
|
(add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend)
|
|
|
|
@end example
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@node The legacy Proc backend
|
|
|
|
@chapter The legacy ``Proc'' backend
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex legacy proc backend
|
2017-09-27 17:42:02 +00:00
|
|
|
|
|
|
|
@menu
|
|
|
|
* Proc customization variables::
|
|
|
|
* Adding support for a new syntax check tool::
|
|
|
|
* Implementation overview::
|
|
|
|
* Making a temporary copy::
|
|
|
|
* Locating a master file::
|
|
|
|
* Getting the include directories::
|
|
|
|
* Locating the buildfile::
|
|
|
|
* Starting the syntax check process::
|
|
|
|
* Parsing the output::
|
|
|
|
* Interaction with other modes::
|
|
|
|
@end menu
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@findex flymake-proc-legacy-backend
|
2017-09-27 17:42:02 +00:00
|
|
|
The backend @code{flymake-proc-legacy-backend} was originally designed
|
|
|
|
to be extended for supporting new syntax check tools and error message
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
patterns. It is also controlled by its own set of customization variables
|
2017-09-27 17:42:02 +00:00
|
|
|
|
|
|
|
@node Proc customization variables
|
|
|
|
@section Customization variables for the Proc backend
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex proc backend customization variables
|
2017-09-27 17:42:02 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@vtable @code
|
2017-09-27 17:42:02 +00:00
|
|
|
@item flymake-proc-allowed-file-name-masks
|
|
|
|
A list of @code{(filename-regexp, init-function, cleanup-function
|
|
|
|
getfname-function)} for configuring syntax check tools. @xref{Adding
|
|
|
|
support for a new syntax check tool}.
|
|
|
|
|
|
|
|
@item flymake-proc-master-file-dirs
|
|
|
|
A list of directories for searching a master file. @xref{Locating a
|
|
|
|
master file}.
|
|
|
|
|
|
|
|
@item flymake-proc-get-project-include-dirs-function
|
|
|
|
A function used for obtaining a list of project include dirs (C/C++
|
|
|
|
specific). @xref{Getting the include directories}.
|
|
|
|
|
|
|
|
@item flymake-proc-master-file-count-limit
|
|
|
|
@itemx flymake-proc-check-file-limit
|
|
|
|
Used when looking for a master file. @xref{Locating a master file}.
|
|
|
|
|
|
|
|
@item flymake-proc-err-line-patterns
|
|
|
|
Patterns for error/warning messages in the form @code{(regexp file-idx
|
|
|
|
line-idx col-idx err-text-idx)}. @xref{Parsing the output}.
|
|
|
|
|
|
|
|
@item flymake-proc-diagnostic-type-pred
|
2018-06-05 14:13:02 +00:00
|
|
|
A function to classify a diagnostic text as particular type of error.
|
|
|
|
Should be a function taking an error text and returning a diagnostic
|
|
|
|
symbol (@pxref{Flymake error types}). If non-nil is returned but
|
|
|
|
there is no such symbol in that table, a warning is assumed. If nil
|
|
|
|
is returned, an error is assumed. Can also be a regular expression
|
|
|
|
that should match only warnings. This variable replaces the old
|
|
|
|
@code{flymake-warning-re} and @code{flymake-warning-predicate}.
|
2017-09-27 17:42:02 +00:00
|
|
|
|
|
|
|
@item flymake-proc-compilation-prevents-syntax-check
|
|
|
|
A flag indicating whether compilation and syntax check of the same
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
file cannot be run simultaneously. @xref{Interaction with other modes}.
|
|
|
|
@end vtable
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@node Adding support for a new syntax check tool
|
|
|
|
@section Adding support for a new syntax check tool
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex adding support for a new syntax check tool
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@menu
|
2012-12-22 16:25:40 +00:00
|
|
|
* Example---Configuring a tool called directly::
|
|
|
|
* Example---Configuring a tool called via make::
|
2007-09-06 05:07:05 +00:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
Syntax check tools are configured using the
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-allowed-file-name-masks} list. Each item of this list
|
2007-09-06 05:07:05 +00:00
|
|
|
has the following format:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(filename-regexp, init-function, cleanup-function, getfname-function)
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
@item filename-regexp
|
|
|
|
This field is used as a key for locating init/cleanup/getfname
|
|
|
|
functions for the buffer. Items in
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-allowed-file-name-masks} are searched sequentially.
|
|
|
|
The first item with @code{filename-regexp} matching buffer filename is
|
2013-05-25 01:26:12 +00:00
|
|
|
selected. If no match is found, @code{flymake-mode} is switched off.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@item init-function
|
|
|
|
@code{init-function} is required to initialize the syntax check,
|
2013-05-25 01:26:12 +00:00
|
|
|
usually by creating a temporary copy of the buffer contents. The
|
|
|
|
function must return @code{(list cmd-name arg-list)}. If
|
2017-10-06 13:08:49 +00:00
|
|
|
@code{init-function} returns null, syntax check is aborted, but
|
2007-09-06 05:07:05 +00:00
|
|
|
@code{flymake-mode} is not switched off.
|
|
|
|
|
|
|
|
@item cleanup-function
|
|
|
|
@code{cleanup-function} is called after the syntax check process is
|
|
|
|
complete and should take care of proper deinitialization, which is
|
|
|
|
usually deleting a temporary copy created by the @code{init-function}.
|
|
|
|
|
|
|
|
@item getfname-function
|
|
|
|
This function is used for translating filenames reported by the syntax
|
2013-05-25 01:26:12 +00:00
|
|
|
check tool into ``real'' filenames. Filenames reported by the tool
|
2007-09-06 05:07:05 +00:00
|
|
|
will be different from the real ones, as actually the tool works with
|
|
|
|
the temporary copy. In most cases, the default implementation
|
2017-09-27 17:42:02 +00:00
|
|
|
provided by Flymake, @code{flymake-proc-get-real-file-name}, can be
|
|
|
|
used as @code{getfname-function}.
|
2007-09-06 05:07:05 +00:00
|
|
|
@end table
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
To add support for a new syntax check tool, write the corresponding
|
2017-10-06 13:08:49 +00:00
|
|
|
@code{init-function} and, optionally, @code{cleanup-function} and
|
2007-09-06 05:07:05 +00:00
|
|
|
@code{getfname-function}. If the format of error messages reported by
|
|
|
|
the new tool is not yet supported by Flymake, add a new entry to
|
2017-09-27 17:42:02 +00:00
|
|
|
the @code{flymake-proc-err-line-patterns} list.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
The following sections contain some examples of configuring Flymake
|
|
|
|
support for various syntax check tools.
|
|
|
|
|
2012-12-22 16:25:40 +00:00
|
|
|
@node Example---Configuring a tool called directly
|
|
|
|
@subsection Example---Configuring a tool called directly
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex adding support for perl
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
In this example, we will add support for @command{perl} as a syntax check
|
|
|
|
tool. @command{perl} supports the @option{-c} option which does syntax
|
2007-09-06 05:07:05 +00:00
|
|
|
checking.
|
|
|
|
|
|
|
|
First, we write the @code{init-function}:
|
|
|
|
|
|
|
|
@lisp
|
2017-09-27 17:42:02 +00:00
|
|
|
(defun flymake-proc-perl-init ()
|
|
|
|
(let* ((temp-file (flymake-proc-init-create-temp-buffer-copy
|
|
|
|
'flymake-proc-create-temp-inplace))
|
Untabify doc/misc/*.texi.
* autotype.texi, cl.texi, dired-x.texi, ebrowse.texi, ede.texi:
* eieio.texi, faq.texi, flymake.texi, forms.texi, gnus-faq.texi:
* idlwave.texi, mh-e.texi, org.texi, pcl-cvs.texi, pgg.texi:
* reftex.texi, sasl.texi, sc.texi, sem-user.texi, semantic.texi:
* sieve.texi, smtpmail.texi, speedbar.texi, vip.texi, viper.texi:
* widget.texi: Untabify (except for examples).
2010-06-23 02:57:26 +00:00
|
|
|
(local-file (file-relative-name
|
2007-11-20 12:39:52 +00:00
|
|
|
temp-file
|
|
|
|
(file-name-directory buffer-file-name))))
|
2007-09-06 05:07:05 +00:00
|
|
|
(list "perl" (list "-wc " local-file))))
|
|
|
|
@end lisp
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-perl-init} creates a temporary copy of the buffer
|
2007-09-06 05:07:05 +00:00
|
|
|
contents with the help of
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-init-create-temp-buffer-copy}, and builds an appropriate
|
2007-09-06 05:07:05 +00:00
|
|
|
command line.
|
|
|
|
|
|
|
|
Next, we add a new entry to the
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-allowed-file-name-masks}:
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@lisp
|
2017-09-27 17:42:02 +00:00
|
|
|
(setq flymake-proc-allowed-file-name-masks
|
2007-09-06 05:07:05 +00:00
|
|
|
(cons '(".+\\.pl$"
|
2017-09-27 17:42:02 +00:00
|
|
|
flymake-proc-perl-init
|
|
|
|
flymake-proc-simple-cleanup
|
|
|
|
flymake-proc-get-real-file-name)
|
|
|
|
flymake-proc-allowed-file-name-masks))
|
2007-09-06 05:07:05 +00:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
Note that we use standard @code{cleanup-function} and
|
|
|
|
@code{getfname-function}.
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
Finally, we add an entry to @code{flymake-proc-err-line-patterns}:
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@lisp
|
2017-09-27 17:42:02 +00:00
|
|
|
(setq flymake-proc-err-line-patterns
|
2007-09-06 05:07:05 +00:00
|
|
|
(cons '("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]"
|
|
|
|
2 3 nil 1)
|
2017-09-27 17:42:02 +00:00
|
|
|
flymake-proc-err-line-patterns))
|
2007-09-06 05:07:05 +00:00
|
|
|
@end lisp
|
|
|
|
|
2012-12-22 16:25:40 +00:00
|
|
|
@node Example---Configuring a tool called via make
|
|
|
|
@subsection Example---Configuring a tool called via make
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex adding support for C (gcc+make)
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
In this example we will add support for C files syntax checked by
|
2012-03-10 04:10:21 +00:00
|
|
|
@command{gcc} called via @command{make}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
We're not required to write any new functions, as Flymake already has
|
2013-05-25 01:26:12 +00:00
|
|
|
functions for @command{make}. We just add a new entry to the
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-allowed-file-name-masks}:
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@lisp
|
2017-09-27 17:42:02 +00:00
|
|
|
(setq flymake-proc-allowed-file-name-masks
|
2007-09-06 05:07:05 +00:00
|
|
|
(cons '(".+\\.c$"
|
2017-09-27 17:42:02 +00:00
|
|
|
flymake-proc-simple-make-init
|
|
|
|
flymake-proc-simple-cleanup
|
|
|
|
flymake-proc-get-real-file-name)
|
|
|
|
flymake-proc-allowed-file-name-masks))
|
2007-09-06 05:07:05 +00:00
|
|
|
@end lisp
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-simple-make-init} builds the following @command{make}
|
2007-09-06 05:07:05 +00:00
|
|
|
command line:
|
|
|
|
|
|
|
|
@lisp
|
|
|
|
(list "make"
|
|
|
|
(list "-s" "-C"
|
|
|
|
base-dir
|
|
|
|
(concat "CHK_SOURCES=" source)
|
|
|
|
"SYNTAX_CHECK_MODE=1"
|
|
|
|
"check-syntax"))
|
|
|
|
@end lisp
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@code{base-dir} is a directory containing the @file{Makefile}, see
|
|
|
|
@ref{Locating the buildfile}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
Thus, @file{Makefile} must contain the @code{check-syntax} target. In
|
2007-09-06 05:07:05 +00:00
|
|
|
our case this target might look like this:
|
|
|
|
|
|
|
|
@verbatim
|
|
|
|
check-syntax:
|
2017-09-28 11:06:56 +00:00
|
|
|
gcc -o /dev/null -S ${CHK_SOURCES} || true
|
2007-09-06 05:07:05 +00:00
|
|
|
@end verbatim
|
|
|
|
|
2012-03-10 04:10:21 +00:00
|
|
|
@noindent
|
|
|
|
The format of error messages reported by @command{gcc} is already
|
2007-09-06 05:07:05 +00:00
|
|
|
supported by Flymake, so we don't have to add a new entry to
|
2012-03-10 04:10:21 +00:00
|
|
|
@code{flymake-err-line-patterns}. Note that if you are using
|
|
|
|
Automake, you may want to replace @code{gcc} with the standard
|
|
|
|
Automake variable @code{COMPILE}:
|
|
|
|
|
|
|
|
@verbatim
|
|
|
|
check-syntax:
|
2017-09-28 11:06:56 +00:00
|
|
|
$(COMPILE) -o /dev/null -S ${CHK_SOURCES} || true
|
2012-03-10 04:10:21 +00:00
|
|
|
@end verbatim
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@node Implementation overview
|
|
|
|
@section Implementation overview
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex syntax check models
|
|
|
|
@cindex master file
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-legacy-backend} saves a copy of the buffer in a
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
temporary file in the buffer's directory (or in the system temporary
|
2017-10-06 13:08:49 +00:00
|
|
|
directory, for Java files), creates a syntax check command and
|
2017-09-27 17:42:02 +00:00
|
|
|
launches a process with this command. The output is parsed using a
|
|
|
|
list of error message patterns, and error information (file name, line
|
|
|
|
number, type and text) is saved. After the process has finished,
|
|
|
|
Flymake highlights erroneous lines in the buffer using the accumulated
|
|
|
|
error information.
|
|
|
|
|
2007-09-06 05:07:05 +00:00
|
|
|
Syntax check is considered possible if there's an entry in
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-allowed-file-name-masks} matching buffer's filename and
|
2007-09-06 05:07:05 +00:00
|
|
|
its @code{init-function} returns non-@code{nil} value.
|
|
|
|
|
|
|
|
Two syntax check modes are distinguished:
|
|
|
|
|
|
|
|
@enumerate
|
|
|
|
|
|
|
|
@item
|
|
|
|
Buffer can be syntax checked in a standalone fashion, that is, the
|
|
|
|
file (its temporary copy, in fact) can be passed over to the compiler to
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
do the syntax check. Examples are C/C@t{++} sources (@file{.c},
|
|
|
|
@file{.cpp}) and Java (@file{.java}).
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@item
|
|
|
|
Buffer can be syntax checked, but additional file, called master file,
|
2013-05-25 01:26:12 +00:00
|
|
|
is required to perform this operation. A master file is a file that
|
2007-09-06 05:07:05 +00:00
|
|
|
includes the current file, so that running a syntax check tool on it
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
will also check syntax in the current file. Examples are C/C@t{++}
|
|
|
|
headers (@file{.h}, @file{.hpp}).
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@end enumerate
|
|
|
|
|
|
|
|
These modes are handled inside init/cleanup/getfname functions, see
|
|
|
|
@ref{Adding support for a new syntax check tool}.
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The Proc backend contains implementations of all functionality
|
|
|
|
required to support different syntax check modes described above
|
|
|
|
(making temporary copies, finding master files, etc.), as well as some
|
|
|
|
tool-specific (routines for Make, Ant, etc.)@: code.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
@node Making a temporary copy
|
|
|
|
@section Making a temporary copy
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex temporary copy of the buffer
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
After the possibility of the syntax check has been determined, a
|
|
|
|
temporary copy of the current buffer is made so that the most recent
|
2013-05-25 01:26:12 +00:00
|
|
|
unsaved changes could be seen by the syntax check tool. Making a copy
|
2007-09-06 05:07:05 +00:00
|
|
|
is quite straightforward in a standalone case (mode @code{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
|
|
|
|
|
|
|
|
@itemize @bullet
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@item
|
|
|
|
locate a master file
|
|
|
|
@item
|
|
|
|
patch it to include the current file using its new (temporary) name.
|
2007-09-06 05:07:05 +00:00
|
|
|
@end itemize
|
|
|
|
|
|
|
|
Locating a master file is discussed in the following section.
|
|
|
|
|
|
|
|
Patching just changes all appropriate lines of the master file so that they
|
2013-05-25 01:26:12 +00:00
|
|
|
use the new (temporary) name of the current file. For example, suppose current
|
2007-09-06 05:07:05 +00:00
|
|
|
file name is @code{file.h}, the master file is @code{file.cpp}, and
|
2013-05-25 01:26:12 +00:00
|
|
|
it includes current file via @code{#include "file.h"}. Current file's copy
|
2007-09-06 05:07:05 +00:00
|
|
|
is saved to file @code{file_flymake.h}, so the include line must be
|
2013-05-25 01:26:12 +00:00
|
|
|
changed to @code{#include "file_flymake.h"}. Finally, patched master file
|
2007-09-06 05:07:05 +00:00
|
|
|
is saved to @code{file_flymake_master.cpp}, and the last one is passed to
|
|
|
|
the syntax check tool.
|
|
|
|
|
|
|
|
@node Locating a master file
|
|
|
|
@section Locating a master file
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex locating a master file
|
|
|
|
@cindex master file, locating
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
Master file is located in two steps.
|
|
|
|
|
2013-05-25 01:26:12 +00:00
|
|
|
First, a list of possible master files is built. A simple name
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
matching is used to find the files. For a C++ header @file{file.h},
|
|
|
|
the Proc backend searches for all @file{.cpp} files in the directories
|
2017-09-27 17:42:02 +00:00
|
|
|
whose relative paths are stored in a customizable variable
|
|
|
|
@code{flymake-proc-master-file-dirs}, which usually contains something
|
|
|
|
like @code{("." "./src")}. No more than
|
|
|
|
@code{flymake-proc-master-file-count-limit} entries is added to the
|
|
|
|
master file list. The list is then sorted to move files with names
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@file{file.cpp} to the top.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
Next, each master file in a list is checked to contain the appropriate
|
2017-09-27 17:42:02 +00:00
|
|
|
include directives. No more than @code{flymake-proc-check-file-limit} of each
|
2007-09-06 05:07:05 +00:00
|
|
|
file are parsed.
|
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
For @file{file.h}, the include directives to look for are
|
2013-05-25 01:26:12 +00:00
|
|
|
@code{#include "file.h"}, @code{#include "../file.h"}, etc. Each
|
2007-09-06 05:07:05 +00:00
|
|
|
include is checked against a list of include directories
|
|
|
|
(see @ref{Getting the include directories}) to be sure it points to the
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
correct @file{file.h}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2013-05-25 01:26:12 +00:00
|
|
|
First matching master file found stops the search. The master file is then
|
|
|
|
patched and saved to disk. In case no master file is found, syntax check is
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
aborted, and corresponding status (@samp{!}) is reported in the mode line.
|
|
|
|
@xref{Syntax check statuses}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@node Getting the include directories
|
|
|
|
@section Getting the include directories
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex include directories (C/C++ specific)
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
Two sets of include directories are distinguished: system include directories
|
2013-05-25 01:26:12 +00:00
|
|
|
and project include directories. The former is just the contents of the
|
|
|
|
@code{INCLUDE} environment variable. The latter is not so easy to obtain,
|
2007-09-06 05:07:05 +00:00
|
|
|
and the way it can be obtained can vary greatly for different projects.
|
|
|
|
Therefore, a customizable variable
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-get-project-include-dirs-function} is used to provide the
|
2007-09-06 05:07:05 +00:00
|
|
|
way to implement the desired behavior.
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The default implementation, @code{flymake-proc-get-project-include-dirs-imp},
|
2013-05-25 01:26:12 +00:00
|
|
|
uses a @command{make} call. This requires a correct base directory, that is, a
|
2012-03-10 04:10:21 +00:00
|
|
|
directory containing a correct @file{Makefile}, to be determined.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
As obtaining the project include directories might be a costly operation, its
|
2013-05-25 01:26:12 +00:00
|
|
|
return value is cached in the hash table. The cache is cleared in the beginning
|
2007-09-06 05:07:05 +00:00
|
|
|
of every syntax check attempt.
|
|
|
|
|
|
|
|
@node Locating the buildfile
|
|
|
|
@section Locating the buildfile
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex locating the buildfile
|
2007-09-06 05:07:05 +00:00
|
|
|
@cindex buildfile, locating
|
|
|
|
@cindex Makefile, locating
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The Proc backend 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 @command{make} for a
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
more complicated case of a C/C@t{++} source. The general idea is
|
|
|
|
that simple files, like Perl scripts and @acronym{HTML} pages, can be checked by
|
2017-09-27 17:42:02 +00:00
|
|
|
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 be passed to the syntax check tool, like
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
include directories for C@t{++}. The latter files are syntax checked
|
2017-09-27 17:42:02 +00:00
|
|
|
using some build tool, like Make or Ant.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2012-03-10 04:10:21 +00:00
|
|
|
All Make configuration data is usually stored in a file called
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@file{Makefile}. To allow for future extensions, Flymake uses a notion of
|
|
|
|
buildfile to reference the @dfn{project configuration} file.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@findex flymake-proc-find-buildfile
|
2017-09-27 17:42:02 +00:00
|
|
|
Special function, @code{flymake-proc-find-buildfile} is provided for locating buildfiles.
|
2007-09-06 05:07:05 +00:00
|
|
|
Searching for a buildfile is done in a manner similar to that of searching
|
2012-12-12 18:37:52 +00:00
|
|
|
for possible master files.
|
|
|
|
@ignore
|
|
|
|
A customizable variable
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-buildfile-dirs} holds a list of relative paths to the
|
2013-05-25 01:26:12 +00:00
|
|
|
buildfile. They are checked sequentially until a buildfile is found.
|
2012-12-12 18:37:52 +00:00
|
|
|
@end ignore
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
In case there's no build file, the syntax check is aborted.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
Buildfile values are also cached.
|
|
|
|
|
|
|
|
@node Starting the syntax check process
|
|
|
|
@section Starting the syntax check process
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex syntax check process, legacy proc backend
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The command line (command name and the list of arguments) for
|
|
|
|
launching a process is returned by the initialization function. The
|
|
|
|
Proc backend then just starts an asynchronous process and configures a
|
|
|
|
process filter and sentinel, which are used for processing the output
|
|
|
|
of the syntax check tool. When exiting Emacs, running processes will
|
|
|
|
be killed without prompting the user.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@node Parsing the output
|
|
|
|
@section Parsing the output
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex parsing the output, legacy proc backend
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
The output generated by the syntax check tool is parsed in the process
|
|
|
|
filter/sentinel using the error message patterns stored in the
|
2017-09-27 17:42:02 +00:00
|
|
|
@code{flymake-proc-err-line-patterns} variable. This variable contains a
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
list of items of the form @w{@code{(regexp file-idx line-idx
|
|
|
|
err-text-idx)}}, used to determine whether a particular line is an
|
2007-09-06 05:07:05 +00:00
|
|
|
error message and extract file name, line number and error text,
|
2013-05-25 01:26:12 +00:00
|
|
|
respectively. Error type (error/warning) is also guessed by matching
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
error text with the @samp{^[wW]arning} pattern. Anything that was not
|
2013-05-25 01:26:12 +00:00
|
|
|
classified as a warning is considered an error. Type is then used to
|
2007-09-06 05:07:05 +00:00
|
|
|
sort error menu items, which shows error messages first.
|
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The Proc backend is also able to interpret error message patterns
|
|
|
|
missing err-text-idx information. This is done by merely taking the
|
|
|
|
rest of the matched line (@code{(substring line (match-end 0))}) as
|
|
|
|
error text. This trick allows making use of a huge collection of
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
error message line patterns from @file{compile.el}. All these error
|
2017-09-27 17:42:02 +00:00
|
|
|
patterns are appended to the end of
|
|
|
|
@code{flymake-proc-err-line-patterns}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
The error information obtained is saved in a buffer local
|
2013-05-25 01:26:12 +00:00
|
|
|
variable. The buffer for which the process output belongs is
|
2007-09-06 05:07:05 +00:00
|
|
|
determined from the process-id@w{}->@w{}buffer mapping updated
|
|
|
|
after every process launch/exit.
|
|
|
|
|
|
|
|
@node Interaction with other modes
|
|
|
|
@section Interaction with other modes
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@cindex interaction with other modes, legacy proc backend
|
|
|
|
@cindex interaction with compile mode, legacy proc backend
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The only mode the Proc backend currently knows about is
|
|
|
|
@code{compile}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
2017-09-27 17:42:02 +00:00
|
|
|
The Proc backend can be configured to not start syntax check if it
|
|
|
|
thinks the compilation is in progress, by testing the
|
2013-05-25 01:26:12 +00:00
|
|
|
@code{compilation-in-progress} variable. The reason why this might be
|
2007-09-06 05:07:05 +00:00
|
|
|
useful is saving CPU time in case both syntax check and compilation
|
2013-05-25 01:26:12 +00:00
|
|
|
are very CPU intensive. The original reason for adding this feature,
|
|
|
|
though, was working around a locking problem with MS Visual C++
|
2017-09-27 17:42:02 +00:00
|
|
|
compiler. The variable in question is
|
|
|
|
@code{flymake-proc-compilation-prevents-syntax-check}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
@findex flymake-proc-compile
|
2017-09-27 17:42:02 +00:00
|
|
|
The Proc backend also provides an alternative command for starting
|
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
2017-10-10 14:08:51 +00:00
|
|
|
compilation, @code{flymake-proc-compile}. It just kills all the active
|
2017-09-27 17:42:02 +00:00
|
|
|
syntax check processes before calling @code{compile}.
|
2007-09-06 05:07:05 +00:00
|
|
|
|
|
|
|
@node GNU Free Documentation License
|
|
|
|
@appendix GNU Free Documentation License
|
|
|
|
@include doclicense.texi
|
|
|
|
|
|
|
|
@node Index
|
|
|
|
@unnumbered Index
|
|
|
|
|
|
|
|
@printindex cp
|
|
|
|
|
|
|
|
@bye
|