aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2017-09-27 18:42:02 +0100
committerJoão Távora2017-10-03 01:07:32 +0100
commitb80d29d15e8bfd4c8594e0cf6cf42733dc308f13 (patch)
tree360ac46e6678a02d512024c488e511fa89f85d1c
parent2971cd063f4a8d5983cb43502e7f672057d0deed (diff)
downloademacs-scratch/flymake-refactor-cleaner-for-emacs-26.tar.gz
emacs-scratch/flymake-refactor-cleaner-for-emacs-26.zip
Start rewriting Flymake manualscratch/flymake-refactor-cleaner-for-emacs-26
* doc/misc/flymake.texi (Overview of Flymake): Rewrite a bit. (Installing Flymake): Delete most of this. (Running the syntax check): Mention flymake-start. (Navigating to error lines): Rewrite. (Viewing error messages): Commente out. (Syntax check statuses, Troubleshooting): Rewrite a bit. (Customizable variables): New section under "Using Flymake". Don't mention any proc variables here. (Configuring Flymake): Delete (Proc backend): New chapter (Proc customization variables): New chapter.
-rw-r--r--doc/misc/flymake.texi268
1 files changed, 132 insertions, 136 deletions
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 01849b7d9a5..61133a079ec 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -4,7 +4,7 @@
4@set VERSION 0.3 4@set VERSION 0.3
5@set UPDATED April 2004 5@set UPDATED April 2004
6@settitle GNU Flymake @value{VERSION} 6@settitle GNU Flymake @value{VERSION}
7@include docstyle.texi 7@include ../emacs/docstyle.texi
8@syncodeindex pg cp 8@syncodeindex pg cp
9@comment %**end of header 9@comment %**end of header
10 10
@@ -53,7 +53,8 @@ modify this GNU manual.''
53* Overview of Flymake:: 53* Overview of Flymake::
54* Installing Flymake:: 54* Installing Flymake::
55* Using Flymake:: 55* Using Flymake::
56* Configuring Flymake:: 56* Extending Flymake::
57* Proc backend::
57* Flymake Implementation:: 58* Flymake Implementation::
58* GNU Free Documentation License:: 59* GNU Free Documentation License::
59* Index:: 60* Index::
@@ -63,29 +64,28 @@ modify this GNU manual.''
63@chapter Overview 64@chapter Overview
64@cindex Overview of Flymake 65@cindex Overview of Flymake
65 66
66Flymake is a universal on-the-fly syntax checker implemented as an 67Flymake is a universal on-the-fly buffer checker implemented as an
67Emacs minor mode. Flymake runs the pre-configured syntax check tool 68Emacs minor mode. When enabled, Flymake visually annotates the buffer
68(compiler for C++ files, @code{perl} for perl files, etc.)@: in the 69with diagnostic information coming from one or more different sources,
69background, passing it a temporary copy of the current buffer, and 70or @emph{backend}.
70parses the output for known error/warning message patterns. Flymake 71
71then highlights erroneous lines (i.e., lines for which at least one 72Historically, Flymake used to accept a diagnostics from a single
72error or warning has been reported by the syntax check tool), and 73backend (albeit a very flexible one) which selected a syntax check
73displays an overall buffer status in the mode line. Status information 74tool from a preconfigured list (compiler for C++ files, @code{perl}
74displayed by Flymake contains total number of errors and warnings 75for perl files, etc.)@: and executed it in the background, passing it
75reported for the buffer during the last syntax check. 76a temporary copy of the current buffer, and parses the output for
77known error/warning message patterns. This backend is still available
78as a fallback and a default(@pxref{Proc backend}).
79
80Flymake annotates the buffer by highlighting erroneous lines or
81regions and displays an overall buffer status in the mode line.
82Status information displayed by Flymake contains totals for different
83types of diagnostics.
76 84
77@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} 85@code{flymake-goto-next-error} and @code{flymake-goto-prev-error}
78functions allow for easy navigation to the next/previous erroneous 86functions allow for easy navigation to the next/previous erroneous
79line, respectively. 87line, respectively. When @code{flymake-mode} is active, they are
80 88mapped to @kbd{M-n} and @kbd{M-p}, respectively, and by default.
81Calling @code{flymake-display-err-menu-for-current-line} will popup a
82menu containing error messages reported by the syntax check tool for
83the current line. Errors/warnings belonging to another file, such as a
84@code{.h} header file included by a @code{.c} file, are shown in the
85current buffer as belonging to the first line. Menu items for such
86messages also contain a filename and a line number. Selecting such a
87menu item will automatically open the file and jump to the line with
88error.
89 89
90Syntax check is done ``on-the-fly''. It is started whenever 90Syntax check is done ``on-the-fly''. It is started whenever
91 91
@@ -97,33 +97,15 @@ delay is configurable).
97@end itemize 97@end itemize
98 98
99Flymake is a universal syntax checker in the sense that it's easily 99Flymake is a universal syntax checker in the sense that it's easily
100extended to support new syntax check tools and error message 100extended to support new backends. @xref{Customizable variables}.
101patterns. @xref{Configuring Flymake}.
102 101
103@node Installing Flymake 102@node Installing Flymake
104@chapter Installing 103@chapter Installing
105@cindex Installing Flymake 104@cindex Installing Flymake
106 105
107 106Flymake is included with Emacs and its main commands, like
108Flymake is packaged in a single file, @code{flymake.el}. 107@code{flymake-mode}, are autoloaded. This means there is usually
109 108nothing to do by way of installation.
110To install/update Flymake, place @code{flymake.el} to a directory
111somewhere on Emacs load path. You might also want to byte-compile
112@code{flymake.el} to improve performance.
113
114Also, place the following line in the @code{.emacs} file.
115
116@lisp
117(require 'flymake)
118@end lisp
119
120You might also map the most frequently used Flymake functions, such as
121@code{flymake-goto-next-error}, to some keyboard shortcuts:
122
123@lisp
124(global-set-key [f3] 'flymake-display-err-menu-for-current-line)
125(global-set-key [f4] 'flymake-goto-next-error)
126@end lisp
127 109
128@node Using Flymake 110@node Using Flymake
129@chapter Using Flymake 111@chapter Using Flymake
@@ -132,10 +114,10 @@ You might also map the most frequently used Flymake functions, such as
132@menu 114@menu
133* Flymake mode:: 115* Flymake mode::
134* Running the syntax check:: 116* Running the syntax check::
135* Navigating to error lines:: 117* Navigating to error lines:: @c * Viewing error messages::
136* Viewing error messages::
137* Syntax check statuses:: 118* Syntax check statuses::
138* Troubleshooting:: 119* Troubleshooting::
120* Customizable variables::
139@end menu 121@end menu
140 122
141@node Flymake mode 123@node Flymake mode
@@ -161,10 +143,9 @@ line in @code{.emacs}:
161 143
162When @code{flymake-mode} is active, syntax check is started 144When @code{flymake-mode} is active, syntax check is started
163automatically on any of the three conditions mentioned above. Syntax 145automatically on any of the three conditions mentioned above. Syntax
164check can also be started manually by using the 146check can also be started manually by using the @code{flymake-start}
165@code{flymake-start-syntax-check-for-current-buffer} function. This 147function. This can be used, for example, when changes were made to
166can be used, for example, when changes were made to some other buffer 148some other buffer affecting the current buffer.
167affecting the current buffer.
168 149
169@node Navigating to error lines 150@node Navigating to error lines
170@section Navigating to error lines 151@section Navigating to error lines
@@ -185,21 +166,24 @@ navigate the highlighted lines.
185 166
186@end multitable 167@end multitable
187 168
188These functions treat erroneous lines as a linked list. Therefore, 169If the user options @code{flymake-wrap-around} is active
189@code{flymake-goto-next-error} will go to the first erroneous line 170(@pxref{Customizable variables}), these functions treat diagnostics
190when invoked in the end of the buffer. 171as a linked list. Therefore, @code{flymake-goto-next-error} will go
191 172to the first diagnostic when invoked in the end of the buffer.
192@node Viewing error messages 173
193@section Viewing error messages 174@c jt@2017/09/27: The latest redesign more than likely broke this.
194@cindex Viewing error messages 175@c
195 176@c @node Viewing error messages
196To view error messages belonging to the current line, use the 177@c @section Viewing error messages
197@code{flymake-display-err-menu-for-current-line} function. If there's 178@c @cindex Viewing error messages
198at least one error or warning reported for the current line, this 179
199function will display a popup menu with error/warning texts. 180@c To view error messages belonging to the current line, use the
200Selecting the menu item whose error belongs to another file brings 181@c @code{flymake-display-err-menu-for-current-line} function. If there's
201forward that file with the help of the 182@c at least one error or warning reported for the current line, this
202@code{flymake-goto-file-and-line} function. 183@c function will display a popup menu with error/warning texts.
184@c Selecting the menu item whose error belongs to another file brings
185@c forward that file with the help of the
186@c @code{flymake-goto-file-and-line} function.
203 187
204@node Syntax check statuses 188@node Syntax check statuses
205@section Syntax check statuses 189@section Syntax check statuses
@@ -209,29 +193,22 @@ After syntax check is finished, its status is displayed in the mode line.
209The following statuses are defined. 193The following statuses are defined.
210 194
211@multitable @columnfractions 0.25 0.75 195@multitable @columnfractions 0.25 0.75
212@item Flymake* or Flymake:E/W* 196@item Flymake:run
213@tab Flymake is currently running. For the second case, E/W contains the 197@tab Flymake is currently running at least one backend.
214error and warning count for the previous run.
215 198
216@item Flymake 199@item Flymake
217@tab Syntax check is not running. Usually this means syntax check was 200@tab Flymake was unable to successfully execute any backend.
218successfully passed (no errors, no warnings). Other possibilities are:
219syntax check was killed as a result of executing
220@code{flymake-compile}, or syntax check cannot start as compilation
221is currently in progress.
222
223@item Flymake:E/W
224@tab Number of errors/warnings found by the syntax check process.
225 201
226@item Flymake:! 202@item Flymake [<errors> <warnings> ... ]
227@tab Flymake was unable to find master file for the current buffer. 203@tab Normal operation, number of errors/warnings found by the syntax check process.
228@end multitable 204@end multitable
229 205
230The following errors cause a warning message and switch flymake mode 206The default backend @code{flymake-proc-legacy-flymake} may encounter
231OFF for the buffer. 207some situations that cause a warning message to the @code{*Flymake
208log*} buffer.
232 209
233@multitable @columnfractions 0.25 0.75 210@multitable @columnfractions 0.25 0.75
234@item CFGERR 211@item @code{:configuration-error}
235@tab Syntax check process returned nonzero exit code, but no 212@tab Syntax check process returned nonzero exit code, but no
236errors/warnings were reported. This indicates a possible configuration 213errors/warnings were reported. This indicates a possible configuration
237error (for example, no suitable error message patterns for the 214error (for example, no suitable error message patterns for the
@@ -243,10 +220,11 @@ syntax check tool).
243@item NOMK 220@item NOMK
244@tab Flymake was unable to find a suitable buildfile for the current buffer. 221@tab Flymake was unable to find a suitable buildfile for the current buffer.
245 222
246@item PROCERR 223@item @code{:make-process-error}
247@tab Flymake was unable to launch a syntax check process. 224@tab Flymake was unable to launch a syntax check process.
248@end multitable 225@end multitable
249 226
227These ``panic'' situations cause the backend to be disabled.
250 228
251@node Troubleshooting 229@node Troubleshooting
252@section Troubleshooting 230@section Troubleshooting
@@ -255,97 +233,115 @@ syntax check tool).
255 233
256Flymake uses a simple logging facility for indicating important points 234Flymake uses a simple logging facility for indicating important points
257in the control flow. The logging facility sends logging messages to 235in the control flow. The logging facility sends logging messages to
258the @file{*Messages*} buffer. The information logged can be used for 236the @file{*Flymake log*} buffer. The information logged can be used for
259resolving various problems related to Flymake. 237resolving various problems related to Flymake.
260 238
261Logging output is controlled by the @code{flymake-log-level} 239Logging output is controlled by the Emacs @code{warning-minimum-log-level}
262variable. @code{3} is the most verbose level, and @code{-1} switches 240and @code{warning-minimum-level} variables.
263logging off. 241
242@node Customizable variables
243@section Customizable variables
244@cindex Customizable variables
245
246This section summarizes variables used for the configuration of the
247Flymake user interface.
248
249@table @code
250@item flymake-no-changes-timeout
251If any changes are made to the buffer, syntax check is automatically
252started after @code{flymake-no-changes-timeout} seconds.
253
254@item flymake-start-syntax-check-on-newline
255A boolean flag indicating whether to start syntax check after a
256newline character is added to the buffer.
257
258@item flymake-error
259A custom face for highlighting regions for which an error has been
260reported.
261
262@item flymake-warning
263A custom face for highlighting regions for which a warning has been
264reported.
265
266@item flymake-note
267A custom face for highlighting regions for which a note has been
268reported.
269
270@item flymake-error-bitmap
271A bitmap used in the fringe to mark lines for which an error has
272been reported.
273
274@item flymake-warning-bitmap
275A bitmap used in the fringe to mark lines for which a warning has
276been reported.
277
278@item flymake-fringe-indicator-position
279Which fringe (if any) should show the warning/error bitmaps.
280
281@item flymake-wrap-around
282If non-nil, moving to errors with @code{flymake-goto-next-error} and
283@code{flymake-goto-prev-error} wraps around buffer boundaries.
284
285@end table
286
287@node Extending Flymake
288@chapter Extending Flymake
289@cindex Extending Flymake
264 290
265@node Configuring Flymake 291@node Proc backend
266@chapter Configuring and Extending Flymake 292@chapter The legacy ``Proc'' backend
267@cindex Configuring and Extending Flymake 293@cindex Proc backend
268 294
269@menu 295@menu
270* Customizable variables:: 296* Proc customization variables::
271* Adding support for a new syntax check tool:: 297* Adding support for a new syntax check tool::
272@end menu 298@end menu
273 299
274Flymake was designed to be easily extended for supporting new syntax 300The backend @code{flymake-proc-legacy-backend} was originally designed
275check tools and error message patterns. 301to be extended for supporting new syntax check tools and error message
276 302patterns. It is also controlled by its own set of customization variables
277@node Customizable variables
278@section Customizable variables
279@cindex Customizable variables
280 303
281This section summarizes variables used for Flymake 304@node Proc customization variables
282configuration. 305@section Customization variables for the Proc backend
306@cindex Proc customization variables
283 307
284@table @code 308@table @code
285@item flymake-log-level 309@item flymake-proc-log-level
286Controls logging output, see @ref{Troubleshooting}. 310Controls logging output, see @ref{Troubleshooting}.
287 311
288@item flymake-allowed-file-name-masks 312@item flymake-proc-allowed-file-name-masks
289A list of @code{(filename-regexp, init-function, cleanup-function 313A list of @code{(filename-regexp, init-function, cleanup-function
290getfname-function)} for configuring syntax check tools. @xref{Adding 314getfname-function)} for configuring syntax check tools. @xref{Adding
291support for a new syntax check tool}. 315support for a new syntax check tool}.
292 316
293@ignore 317@ignore
294@item flymake-buildfile-dirs 318@item flymake-proc-buildfile-dirs
295A list of directories (relative paths) for searching a 319A list of directories (relative paths) for searching a
296buildfile. @xref{Locating the buildfile}. 320buildfile. @xref{Locating the buildfile}.
297@end ignore 321@end ignore
298 322
299@item flymake-master-file-dirs 323@item flymake-proc-master-file-dirs
300A list of directories for searching a master file. @xref{Locating a 324A list of directories for searching a master file. @xref{Locating a
301master file}. 325master file}.
302 326
303@item flymake-get-project-include-dirs-function 327@item flymake-proc-get-project-include-dirs-function
304A function used for obtaining a list of project include dirs (C/C++ 328A function used for obtaining a list of project include dirs (C/C++
305specific). @xref{Getting the include directories}. 329specific). @xref{Getting the include directories}.
306 330
307@item flymake-master-file-count-limit 331@item flymake-proc-master-file-count-limit
308@itemx flymake-check-file-limit 332@itemx flymake-proc-check-file-limit
309Used when looking for a master file. @xref{Locating a master file}. 333Used when looking for a master file. @xref{Locating a master file}.
310 334
311@item flymake-err-line-patterns 335@item flymake-proc-err-line-patterns
312Patterns for error/warning messages in the form @code{(regexp file-idx 336Patterns for error/warning messages in the form @code{(regexp file-idx
313line-idx col-idx err-text-idx)}. @xref{Parsing the output}. 337line-idx col-idx err-text-idx)}. @xref{Parsing the output}.
314 338
315@item flymake-warning-predicate 339@item flymake-proc-warning-predicate
316Predicate to classify error text as warning. @xref{Parsing the output}. 340Predicate to classify error text as warning. @xref{Parsing the output}.
317 341
318@item flymake-compilation-prevents-syntax-check 342@item flymake-proc-compilation-prevents-syntax-check
319A flag indicating whether compilation and syntax check of the same 343A flag indicating whether compilation and syntax check of the same
320file cannot be run simultaneously. 344file cannot be run simultaneously.
321
322@item flymake-no-changes-timeout
323If any changes are made to the buffer, syntax check is automatically
324started after @code{flymake-no-changes-timeout} seconds.
325
326@item flymake-start-syntax-check-on-newline
327A boolean flag indicating whether to start syntax check after a
328newline character is added to the buffer.
329
330@item flymake-errline
331A custom face for highlighting lines for which at least one error has
332been reported.
333
334@item flymake-warnline
335A custom face for highlighting lines for which at least one warning
336and no errors have been reported.
337
338@item flymake-error-bitmap
339A bitmap used in the fringe to mark lines for which an error has
340been reported.
341
342@item flymake-warning-bitmap
343A bitmap used in the fringe to mark lines for which a warning has
344been reported.
345
346@item flymake-fringe-indicator-position
347Which fringe (if any) should show the warning/error bitmaps.
348
349@end table 345@end table
350 346
351@node Adding support for a new syntax check tool 347@node Adding support for a new syntax check tool