diff options
| author | Paul Eggert | 2017-10-12 13:44:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-10-12 13:44:16 -0700 |
| commit | 3d0d5b4ebdf19876104d23402606f2b3cc636aca (patch) | |
| tree | 87febb7bc2409f9502c86802a46915c01c546e7c /doc | |
| parent | 36375d35aa06e84865cce678559ddfa8f79a9775 (diff) | |
| parent | 05d0c0f80291d25ea228d4a8572d58540bf08b52 (diff) | |
| download | emacs-3d0d5b4ebdf19876104d23402606f2b3cc636aca.tar.gz emacs-3d0d5b4ebdf19876104d23402606f2b3cc636aca.zip | |
Merge from origin/emacs-26
05d0c0f802 ; * ChangeLog.3: ChangeLog fixes.
fbabae6b24 * ChangeLog.3: Update.
eab051991e Fix docstring style for 'functionp'
e8a7c41b4e Format shell commands in tramp.texi
0526aac4eb Unbreak the button in the Flymake diagnostics buffer again
c89f001de1 Add mode map to Flymake diagnostic button
f9cd8ee681 Tweak the Flymake diagnostics buffer again
0e83f5f279 Simplify Flymake diagnostics buffer UX
cf4a15b9b6 First stab at a Flymake diagnostics buffer
e4a1556392 * etc/NEWS (Flymake): Rewrite entry.
00adeb43e9 Improve the Flymake manual
44c6401733 ; * etc/NEWS: Clarify the description of "---" and "+++".
042b3cfbd2 Fix two Flymake bugs
3dfa2ca4dc Don't log "emergencies" in the Flymake legacy backend
1c2e188440 Add full documentation on new Flymake API
0f7f677f82 Fix some Flymake docstrings and messages
21e7075781 Make three new Flymake commands for debugging common problems
c9be9a3678 ; INSTALL.REPO: Add -d to "thorough cleaning" suggestion.
5d51403ceb ; Typo fixes, mostly repeated words
0d004ed01a ; Spelling fixes
0485aa76c9 ; * src/lread.c (syms_of_lread) <module-file-suffix>: Fix ...
ba7fb37d6a * admin/authors.el (authors-renamed-files-alist): addition.
14dca4a79a ; ChangeLog.3 fixes
f352d0257c Fix PWD check on DOS_NT
934f08f3de Fix unlikely overflows with wd length
6c2b1e89ef * lisp/gnus/message.el: Improve last commit
7ed7360855 Fix problems when editing raw undecoded message (Bug#28671)
aca5f0072b Avoid encoding errors in message.el
0c36663db5 Improve doc string and prompt of 'grep-read-files'
2da83c9d36 Avoid assertion violations when line numbers are displayed
5b81f65ad0 ; * lisp/emacs-lisp/rmc.el: Minor fix for copyright and li...
11b37b4a9f Be lazy when starting Flymake checks
36ed9a9ede Fix last change in frameset.el
62e5c119af Describe how window dividers can replicate vertical border...
e2150d994a Add line-number faces to the display-line-numbers group
89b0023044 Increase xterm click count only within double-click-fuzz
745aea2296 Change pause in fullscreen toggling for NS port (bug#28496)
1cd334cd47 Handle PARENTS properly in tramp-*-handle-make-directory
f1c73de47d ; Merge from Gnulib (comment changes only)
7c2c117c91 Improve test for unreachable dirs
2202952b83 * src/xsmfns.c (x_session_initialize): Fix memory leak.
a9b72976de Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs i...
64baaff8c5 New option for handling ZWNJ in Arabic text rendering
c194fb61c6 Make python prettify symbols into a defvar (Bug#28713)
6dfc778d54 Fix fullscreen crash on macOS (bug#28496)
3db0dc2168 Fix crash when closing fullscreen frame on macOS (bug#28661)
bc80da5bd3 Support gio tool in Tramp
349e0eb5ff Fix flymake-goto-next-error when message has %-constructs
0fa353b504 * src/gnutls.c (syms_of_gnutls): Remove duplicated call to...
dc6ae15a8d Move the entry about 'format' into Incompatible Lisp Changes
75174a632d Fix glitches in displaying TTY menus
238fbcb20e Create new Edebug spec for docstrings and use it in closures
2d58d51329 Avoid byte-compilation warnings in message.el
# Conflicts:
# etc/NEWS
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/anti.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/frames.texi | 21 | ||||
| -rw-r--r-- | doc/emacs/rmail.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/text.texi | 2 | ||||
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/debugging.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 2 | ||||
| -rw-r--r-- | doc/misc/flymake.texi | 675 | ||||
| -rw-r--r-- | doc/misc/htmlfontify.texi | 2 | ||||
| -rw-r--r-- | doc/misc/ses.texi | 2 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 22 |
12 files changed, 595 insertions, 141 deletions
diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi index 547dbd1b45d..426c18b14e5 100644 --- a/doc/emacs/anti.texi +++ b/doc/emacs/anti.texi | |||
| @@ -25,7 +25,7 @@ less and less available/popular as you move farther back in time. | |||
| 25 | 25 | ||
| 26 | @item | 26 | @item |
| 27 | For similar reasons, we've reverted back to building our own version | 27 | For similar reasons, we've reverted back to building our own version |
| 28 | of of @command{movemail} that retrieves POP3 mail as clear text via | 28 | of @command{movemail} that retrieves POP3 mail as clear text via |
| 29 | insecure channels. As you move back in time, the availability of | 29 | insecure channels. As you move back in time, the availability of |
| 30 | secure alternatives to POP3 will diminish, and we are only keen to | 30 | secure alternatives to POP3 will diminish, and we are only keen to |
| 31 | support that. We've also removed the @option{--with-mailutils} | 31 | support that. We've also removed the @option{--with-mailutils} |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index b168effb3a0..8c08f51825c 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -1002,6 +1002,20 @@ when the entire buffer is visible. | |||
| 1002 | The visual appearance of the scroll bars is controlled by the | 1002 | The visual appearance of the scroll bars is controlled by the |
| 1003 | @code{scroll-bar} face. | 1003 | @code{scroll-bar} face. |
| 1004 | 1004 | ||
| 1005 | @cindex vertical border | ||
| 1006 | On graphical frames, vertical scroll bars implicitly serve to separate | ||
| 1007 | side-by-side windows visually. When vertical scroll bars are disabled, | ||
| 1008 | Emacs by default separates such windows with the help of a one-pixel | ||
| 1009 | wide @dfn{vertical border}. That border occupies the first pixel column | ||
| 1010 | of the window on the right and may thus overdraw the leftmost pixels of | ||
| 1011 | any glyph displayed there. If these pixels convey important | ||
| 1012 | information, you can make them visible by enabling window dividers, see | ||
| 1013 | @ref{Window Dividers}. To replicate the look of vertical borders, set | ||
| 1014 | the @code{right-divider-width} parameter of frames to one and have the | ||
| 1015 | @code{window-divider} face inherit from that of @code{vertical-border}, | ||
| 1016 | @ref{Window Dividers,, Window Dividers, elisp, The Emacs Lisp Reference | ||
| 1017 | Manual}. | ||
| 1018 | |||
| 1005 | @cindex Horizontal Scroll Bar | 1019 | @cindex Horizontal Scroll Bar |
| 1006 | @cindex Horizontal Scroll Bar mode | 1020 | @cindex Horizontal Scroll Bar mode |
| 1007 | On graphical displays with toolkit support, Emacs may also supply a | 1021 | On graphical displays with toolkit support, Emacs may also supply a |
| @@ -1060,7 +1074,12 @@ window-divider-mode}. | |||
| 1060 | customize the options @code{window-divider-default-bottom-width} and | 1074 | customize the options @code{window-divider-default-bottom-width} and |
| 1061 | @code{window-divider-default-right-width}. | 1075 | @code{window-divider-default-right-width}. |
| 1062 | 1076 | ||
| 1063 | For more details about window dividers see @ref{Window Dividers,, | 1077 | When vertical scroll bars are disabled, dividers can be also useful to |
| 1078 | make the first pixel column of a window visible which would be otherwise | ||
| 1079 | covered by the vertical border used to separate side-by-side windows | ||
| 1080 | (@pxref{Scroll Bars}). | ||
| 1081 | |||
| 1082 | For more details about window dividers see @ref{Window Dividers,, | ||
| 1064 | Window Dividers, elisp, The Emacs Lisp Reference Manual}. | 1083 | Window Dividers, elisp, The Emacs Lisp Reference Manual}. |
| 1065 | 1084 | ||
| 1066 | @node Drag and Drop | 1085 | @node Drag and Drop |
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi index f2416a07776..b073687da9c 100644 --- a/doc/emacs/rmail.texi +++ b/doc/emacs/rmail.texi | |||
| @@ -1363,7 +1363,7 @@ message itself is flagged as deleted. | |||
| 1363 | Mailing list messages that might offend or annoy some readers are sometimes | 1363 | Mailing list messages that might offend or annoy some readers are sometimes |
| 1364 | encoded in a simple code called @dfn{rot13}---so named because it | 1364 | encoded in a simple code called @dfn{rot13}---so named because it |
| 1365 | rotates the alphabet by 13 letters. This code is not for secrecy, as it | 1365 | rotates the alphabet by 13 letters. This code is not for secrecy, as it |
| 1366 | provides none; rather, it enables those who wish to to avoid | 1366 | provides none; rather, it enables those who wish to avoid |
| 1367 | seeing the real text of the message. For example, a review of a film | 1367 | seeing the real text of the message. For example, a review of a film |
| 1368 | might use rot13 to hide important plot points. | 1368 | might use rot13 to hide important plot points. |
| 1369 | 1369 | ||
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 5aa0c77d34c..c5967f8cf65 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -1732,7 +1732,7 @@ C-p} (@code{tex-print}) to print a hardcopy of the output file. | |||
| 1732 | @vindex tex-directory | 1732 | @vindex tex-directory |
| 1733 | By default, @kbd{C-c C-b} runs @TeX{} in the current directory. The | 1733 | By default, @kbd{C-c C-b} runs @TeX{} in the current directory. The |
| 1734 | output of @TeX{} also goes in this directory. To run @TeX{} in a | 1734 | output of @TeX{} also goes in this directory. To run @TeX{} in a |
| 1735 | different directory, change the variable @code{tex-directory} to the | 1735 | different directory, change the variable @code{tex-directory} to |
| 1736 | the desired directory. If your environment variable @env{TEXINPUTS} | 1736 | the desired directory. If your environment variable @env{TEXINPUTS} |
| 1737 | contains relative names, or if your files contains | 1737 | contains relative names, or if your files contains |
| 1738 | @samp{\input} commands with relative file names, then | 1738 | @samp{\input} commands with relative file names, then |
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index d9493879b1d..65ded50c396 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi | |||
| @@ -831,7 +831,7 @@ An expert programmer who reviewed this text said to me: | |||
| 831 | @i{I prefer to learn from reference manuals. I ``dive into'' each | 831 | @i{I prefer to learn from reference manuals. I ``dive into'' each |
| 832 | paragraph, and ``come up for air'' between paragraphs.} | 832 | paragraph, and ``come up for air'' between paragraphs.} |
| 833 | 833 | ||
| 834 | @i{When I get to the end of a paragraph, I assume that that subject is | 834 | @i{When I get to the end of a paragraph, I assume that subject is |
| 835 | done, finished, that I know everything I need (with the | 835 | done, finished, that I know everything I need (with the |
| 836 | possible exception of the case when the next paragraph starts talking | 836 | possible exception of the case when the next paragraph starts talking |
| 837 | about it in more detail). I expect that a well written reference manual | 837 | about it in more detail). I expect that a well written reference manual |
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 2ca4a0a849e..fe3446ada2d 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi | |||
| @@ -135,7 +135,7 @@ set @code{debug-ignored-errors} to @code{nil}. | |||
| 135 | @defopt eval-expression-debug-on-error | 135 | @defopt eval-expression-debug-on-error |
| 136 | If this variable has a non-@code{nil} value (the default), running the | 136 | If this variable has a non-@code{nil} value (the default), running the |
| 137 | command @code{eval-expression} causes @code{debug-on-error} to be | 137 | command @code{eval-expression} causes @code{debug-on-error} to be |
| 138 | temporarily bound to to @code{t}. @xref{Lisp Eval,, Evaluating | 138 | temporarily bound to @code{t}. @xref{Lisp Eval,, Evaluating |
| 139 | Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. | 139 | Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. |
| 140 | 140 | ||
| 141 | If @code{eval-expression-debug-on-error} is @code{nil}, then the value | 141 | If @code{eval-expression-debug-on-error} is @code{nil}, then the value |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index af646ce40f4..59c269a3084 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -222,7 +222,7 @@ If it is @code{t}, it selects the @file{*scratch*} buffer. | |||
| 222 | @c called from two places. If displaying a startup screen, they are | 222 | @c called from two places. If displaying a startup screen, they are |
| 223 | @c called in command-line-1 before the startup screen is shown. | 223 | @c called in command-line-1 before the startup screen is shown. |
| 224 | @c inhibit-startup-hooks is then set and window-setup-hook set to nil. | 224 | @c inhibit-startup-hooks is then set and window-setup-hook set to nil. |
| 225 | @c If not displaying a startup screen, they are are called in | 225 | @c If not displaying a startup screen, they are called in |
| 226 | @c normal-top-level. | 226 | @c normal-top-level. |
| 227 | @c FIXME? So it seems they can be called before or after the | 227 | @c FIXME? So it seems they can be called before or after the |
| 228 | @c daemon/session restore step? | 228 | @c daemon/session restore step? |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 23879aad0a3..755fa554bb6 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -327,7 +327,7 @@ expression. Thus, @samp{fo*} has a repeating @samp{o}, not a repeating | |||
| 327 | The matcher processes a @samp{*} construct by matching, immediately, as | 327 | The matcher processes a @samp{*} construct by matching, immediately, as |
| 328 | many repetitions as can be found. Then it continues with the rest of | 328 | many repetitions as can be found. Then it continues with the rest of |
| 329 | the pattern. If that fails, backtracking occurs, discarding some of the | 329 | the pattern. If that fails, backtracking occurs, discarding some of the |
| 330 | matches of the @samp{*}-modified construct in the hope that that will | 330 | matches of the @samp{*}-modified construct in the hope that this will |
| 331 | make it possible to match the rest of the pattern. For example, in | 331 | make it possible to match the rest of the pattern. For example, in |
| 332 | matching @samp{ca*ar} against the string @samp{caaar}, the @samp{a*} | 332 | matching @samp{ca*ar} against the string @samp{caaar}, the @samp{a*} |
| 333 | first tries to match all three @samp{a}s; but the rest of the pattern is | 333 | first tries to match all three @samp{a}s; but the rest of the pattern is |
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index a85fe4a30e1..d89a555ff73 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | \input texinfo @c -*-texinfo-*- | 1 | \input texinfo @c -*-texinfo; coding: utf-8 -*- |
| 2 | @comment %**start of header | 2 | @comment %**start of header |
| 3 | @setfilename ../../info/flymake.info | 3 | @setfilename ../../info/flymake.info |
| 4 | @set VERSION 0.3 | 4 | @set VERSION 0.3 |
| @@ -6,6 +6,8 @@ | |||
| 6 | @settitle GNU Flymake @value{VERSION} | 6 | @settitle GNU Flymake @value{VERSION} |
| 7 | @include docstyle.texi | 7 | @include docstyle.texi |
| 8 | @syncodeindex pg cp | 8 | @syncodeindex pg cp |
| 9 | @syncodeindex vr cp | ||
| 10 | @syncodeindex fn cp | ||
| 9 | @comment %**end of header | 11 | @comment %**end of header |
| 10 | 12 | ||
| 11 | @copying | 13 | @copying |
| @@ -61,32 +63,20 @@ modify this GNU manual.'' | |||
| 61 | 63 | ||
| 62 | @node Overview of Flymake | 64 | @node Overview of Flymake |
| 63 | @chapter Overview | 65 | @chapter Overview |
| 64 | @cindex Overview of Flymake | 66 | @cindex overview of flymake |
| 65 | 67 | ||
| 66 | Flymake is a universal on-the-fly buffer checker implemented as an | 68 | Flymake is a universal on-the-fly buffer checker implemented as an |
| 67 | Emacs minor mode. When enabled, Flymake visually annotates the buffer | 69 | Emacs minor mode. When enabled, Flymake visually annotates the buffer |
| 68 | with diagnostic information coming from one or more different sources, | 70 | with diagnostic information coming from one or more different sources, |
| 69 | or @emph{backends}. | 71 | or @dfn{backends}. |
| 70 | |||
| 71 | Historically, Flymake used to accept diagnostics from a single, albeit | ||
| 72 | reasonably flexible, backend. | ||
| 73 | |||
| 74 | This backend isn't (yet) obsolete and so is still available as a | ||
| 75 | fallback and active by default(@pxref{The legacy Proc backend}). It works by | ||
| 76 | selecting a syntax check tool from a preconfigured list (compiler for | ||
| 77 | C++ files, @code{perl} for perl files, etc.), and executing it in the | ||
| 78 | background, passing it a temporary file which is a copy of the current | ||
| 79 | buffer, and parsing the output for known error/warning message | ||
| 80 | patterns. | ||
| 81 | 72 | ||
| 82 | Flymake annotates the buffer by highlighting problematic buffer | 73 | Flymake annotates the buffer by highlighting problematic buffer |
| 83 | regions with a special space. It also displays an overall buffer | 74 | regions with a special space. It displays an overall buffer status in |
| 84 | status in the mode line. Status information displayed by Flymake | 75 | the mode line containing totals for different types of diagnostics. |
| 85 | contains totals for different types of diagnostics. | ||
| 86 | 76 | ||
| 87 | @code{flymake-goto-next-error} and @code{flymake-goto-prev-error} are | 77 | @code{flymake-goto-next-error} and @code{flymake-goto-prev-error} are |
| 88 | commands that allow easy navigation to the next/previous erroneous | 78 | commands that allow easy navigation to the next/previous erroneous |
| 89 | line, respectively. If might be a good idea to map them to @kbd{M-n} | 79 | line, respectively. If might be a good idea to map them to @kbd{M-n} |
| 90 | and @kbd{M-p} in @code{flymake-mode}, by adding to your init file: | 80 | and @kbd{M-p} in @code{flymake-mode}, by adding to your init file: |
| 91 | 81 | ||
| 92 | @lisp | 82 | @lisp |
| @@ -97,48 +87,67 @@ and @kbd{M-p} in @code{flymake-mode}, by adding to your init file: | |||
| 97 | Syntax check is done ``on-the-fly''. It is started whenever | 87 | Syntax check is done ``on-the-fly''. It is started whenever |
| 98 | 88 | ||
| 99 | @itemize @bullet | 89 | @itemize @bullet |
| 100 | @item @code{flymake-mode} is started; | 90 | @item |
| 101 | @item a newline character is added to the buffer; | 91 | @code{flymake-mode} is started, unless |
| 102 | @item some changes were made to the buffer more than @code{0.5} seconds ago (the | 92 | @code{flymake-start-on-flymake-mode} is nil. |
| 103 | delay is configurable). | 93 | |
| 94 | @item | ||
| 95 | a newline character is added to the buffer, unless | ||
| 96 | @code{flymake-start-syntax-check-on-newline} is nil. | ||
| 97 | |||
| 98 | @item | ||
| 99 | some changes were made to the buffer more than @code{0.5} seconds ago | ||
| 100 | (the delay is configurable in @code{flymake-no-changes-timeout}). | ||
| 104 | @end itemize | 101 | @end itemize |
| 105 | 102 | ||
| 106 | Flymake is a universal syntax checker in the sense that it's easily | 103 | Flymake is a universal syntax checker in the sense that it's easily |
| 107 | extended to support new backends. @xref{Customizable variables}. | 104 | extended to support new backends (@pxref{Extending Flymake}). |
| 105 | |||
| 106 | Historically, Flymake used to accept diagnostics from a single, albeit | ||
| 107 | reasonably flexible, backend. | ||
| 108 | |||
| 109 | This backend isn't (yet) obsolete, and so is still available as a | ||
| 110 | fallback and active by default (@pxref{The legacy Proc backend}). It works by | ||
| 111 | selecting a syntax check tool from a preconfigured list (compiler for | ||
| 112 | C@t{++} files, @command{perl} for Perl files, etc.), and executing it in the | ||
| 113 | background, passing it a temporary file which is a copy of the current | ||
| 114 | buffer, and parsing the output for known error/warning message | ||
| 115 | patterns. | ||
| 108 | 116 | ||
| 109 | @node Installing Flymake | 117 | @node Installing Flymake |
| 110 | @chapter Installing | 118 | @chapter Installing |
| 111 | @cindex Installing Flymake | 119 | @cindex installing flymake |
| 112 | 120 | ||
| 113 | Flymake is included with Emacs and its main commands, like | 121 | Flymake is included with Emacs and its main commands, like |
| 114 | @code{flymake-mode}, are autoloaded. This means there is usually | 122 | @code{flymake-mode}, are autoloaded. This means there is usually |
| 115 | nothing to do by way of installation. | 123 | nothing to do by way of installation. |
| 116 | 124 | ||
| 117 | @node Using Flymake | 125 | @node Using Flymake |
| 118 | @chapter Using Flymake | 126 | @chapter Using Flymake |
| 119 | @cindex Using Flymake | 127 | @cindex using flymake |
| 120 | 128 | ||
| 121 | @menu | 129 | @menu |
| 122 | * Flymake mode:: | 130 | * Flymake mode:: |
| 123 | * Running the syntax check:: | 131 | * Running the syntax check:: |
| 124 | * Navigating to error lines:: @c * Viewing error messages:: | 132 | * Navigating to error lines:: @c * Viewing error messages:: |
| 125 | * Syntax check statuses:: | 133 | * Syntax check statuses:: |
| 126 | * Troubleshooting:: | 134 | * Backend exceptions:: |
| 127 | * Customizable variables:: | 135 | * Customizable variables:: |
| 128 | @end menu | 136 | @end menu |
| 129 | 137 | ||
| 130 | @node Flymake mode | 138 | @node Flymake mode |
| 131 | @section Flymake mode | 139 | @section Flymake mode |
| 132 | @cindex flymake-mode | 140 | @cindex flymake-mode |
| 141 | @cindex activating flymake-mode | ||
| 133 | 142 | ||
| 134 | Flymake is an Emacs minor mode. To use Flymake, you | 143 | Flymake is an Emacs minor mode. To use Flymake, you |
| 135 | must first activate @code{flymake-mode} by using the | 144 | must first activate @code{flymake-mode} by using the command |
| 136 | @code{flymake-mode} function. | 145 | @kbd{flymake-mode}. |
| 137 | 146 | ||
| 138 | Instead of manually activating @code{flymake-mode}, you can configure | 147 | Instead of manually activating @code{flymake-mode}, you can configure |
| 139 | Flymake to automatically enable @code{flymake-mode} upon opening any | 148 | Emacs to automatically enable @code{flymake-mode} upon opening any |
| 140 | file for which syntax check is possible. To do so, place the following | 149 | file for which syntax check is possible. To do so, place the following |
| 141 | line in @code{.emacs}: | 150 | line in your @file{~/.emacs}: |
| 142 | 151 | ||
| 143 | @lisp | 152 | @lisp |
| 144 | (add-hook 'find-file-hook 'flymake-find-file-hook) | 153 | (add-hook 'find-file-hook 'flymake-find-file-hook) |
| @@ -146,31 +155,33 @@ line in @code{.emacs}: | |||
| 146 | 155 | ||
| 147 | @node Running the syntax check | 156 | @node Running the syntax check |
| 148 | @section Running the syntax check | 157 | @section Running the syntax check |
| 149 | @cindex Manually starting the syntax check | 158 | @cindex manually starting syntax check |
| 159 | @cindex syntax check, start manually | ||
| 150 | 160 | ||
| 161 | @findex flymake-start | ||
| 151 | When @code{flymake-mode} is active, syntax check is started | 162 | When @code{flymake-mode} is active, syntax check is started |
| 152 | automatically on any of the three conditions mentioned above. Syntax | 163 | automatically on any of the three conditions mentioned in |
| 153 | check can also be started manually by using the @code{flymake-start} | 164 | @ref{Overview of Flymake}. Syntax check can also be started manually |
| 154 | function. | 165 | by typing the @kbd{M-x flymake-start @key{RET}} command. |
| 155 | 166 | ||
| 156 | @node Navigating to error lines | 167 | @node Navigating to error lines |
| 157 | @section Navigating to error lines | 168 | @section Navigating to error lines |
| 158 | @cindex Navigating to error lines | 169 | @cindex navigating to error lines |
| 159 | 170 | ||
| 160 | After syntax check is completed, lines for which at least one error or | 171 | After syntax check is completed, lines for which at least one error or |
| 161 | warning has been reported are highlighted, and total number of errors | 172 | warning has been reported are highlighted, and the total number of errors |
| 162 | and warning is shown in the mode line. Use the following functions to | 173 | and warning is shown in the mode line. Use the following functions to |
| 163 | navigate the highlighted lines. | 174 | navigate the highlighted lines: |
| 164 | |||
| 165 | @multitable @columnfractions 0.25 0.75 | ||
| 166 | 175 | ||
| 167 | @item @code{flymake-goto-next-error} | 176 | @table @code |
| 168 | @tab Moves point to the next erroneous line, if any. | 177 | @findex flymake-goto-next-error |
| 169 | 178 | @item flymake-goto-next-error | |
| 170 | @item @code{flymake-goto-prev-error} | 179 | Moves point to the next erroneous line, if any. |
| 171 | @tab Moves point to the previous erroneous line. | ||
| 172 | 180 | ||
| 173 | @end multitable | 181 | @findex flymake-goto-prev-error |
| 182 | @item flymake-goto-prev-error | ||
| 183 | Moves point to the previous erroneous line. | ||
| 184 | @end table | ||
| 174 | 185 | ||
| 175 | If the user option @code{flymake-wrap-around} is active | 186 | If the user option @code{flymake-wrap-around} is active |
| 176 | (@pxref{Customizable variables}), these functions treat diagnostics | 187 | (@pxref{Customizable variables}), these functions treat diagnostics |
| @@ -181,7 +192,7 @@ to the first diagnostic when invoked in the end of the buffer. | |||
| 181 | @section Syntax check statuses | 192 | @section Syntax check statuses |
| 182 | @cindex Syntax check statuses | 193 | @cindex Syntax check statuses |
| 183 | 194 | ||
| 184 | After syntax check is finished, its status is displayed in the mode line. | 195 | While enabled, Flymake displays its status in the mode line. |
| 185 | The following statuses are defined: | 196 | The following statuses are defined: |
| 186 | 197 | ||
| 187 | @multitable @columnfractions 0.25 0.75 | 198 | @multitable @columnfractions 0.25 0.75 |
| @@ -191,8 +202,9 @@ where questioned. | |||
| 191 | 202 | ||
| 192 | @item @code{!} | 203 | @item @code{!} |
| 193 | @tab All the configured Flymake backends have disabled themselves. | 204 | @tab All the configured Flymake backends have disabled themselves. |
| 194 | Left-clicking the ``Flymake'' mode line indicator beings the user | 205 | Left-clicking Flymake's mode line indicator pops up a menu listing the |
| 195 | @code{*Flymake log*} buffer where these situations may be investigated | 206 | option to visit Flymake's log buffer. In this buffer these situations |
| 207 | can be investigated. | ||
| 196 | 208 | ||
| 197 | @item @code{?} | 209 | @item @code{?} |
| 198 | @tab There are no configured Flymake backends in | 210 | @tab There are no configured Flymake backends in |
| @@ -203,34 +215,62 @@ Left-clicking the ``Flymake'' mode line indicator beings the user | |||
| 203 | check process. | 215 | check process. |
| 204 | @end multitable | 216 | @end multitable |
| 205 | 217 | ||
| 206 | @node Troubleshooting | 218 | @node Backend exceptions |
| 207 | @section Troubleshooting | 219 | @section Backend exceptions |
| 208 | @cindex Logging | 220 | @cindex backend exceptions |
| 209 | @cindex Troubleshooting | 221 | |
| 210 | 222 | @cindex disabled backends | |
| 211 | Flymake uses a simple logging facility for indicating important points | 223 | @cindex backends, disabled |
| 224 | Some backends may take longer than others to respond or complete, and | ||
| 225 | some may decide to @emph{disable} themselves if they are not suitable | ||
| 226 | for the current buffer. A disabled backend is not tried again for | ||
| 227 | future checks of the current buffer. | ||
| 228 | |||
| 229 | @findex flymake-reporting-backends | ||
| 230 | @findex flymake-running-backends | ||
| 231 | @findex flymake-disabled-backends | ||
| 232 | The commands @code{flymake-reporting-backends}, | ||
| 233 | @code{flymake-running-backends} and @code{flymake-disabled-backends} | ||
| 234 | show the backends currently used and those which are disabled. | ||
| 235 | |||
| 236 | @cindex reset disabled backends | ||
| 237 | Toggling @code{flymake-mode} off and on again, or invoking | ||
| 238 | @code{flymake-start} with a prefix argument is one way to reset the | ||
| 239 | disabled backend list, so that they will be tried again in the next check. | ||
| 240 | |||
| 241 | @cindex logging | ||
| 242 | @cindex flymake logging | ||
| 243 | Flymake also uses a simple logging facility for indicating important points | ||
| 212 | in the control flow. The logging facility sends logging messages to | 244 | in the control flow. The logging facility sends logging messages to |
| 213 | the @file{*Flymake log*} buffer. The information logged can be used for | 245 | the @file{*Flymake log*} buffer. The information logged can be used for |
| 214 | resolving various problems related to Flymake. | 246 | resolving various problems related to Flymake. |
| 215 | 247 | ||
| 248 | @vindex warning-minimum-log-level | ||
| 249 | @vindex warning-minimum-level | ||
| 216 | Logging output is controlled by the Emacs @code{warning-minimum-log-level} | 250 | Logging output is controlled by the Emacs @code{warning-minimum-log-level} |
| 217 | and @code{warning-minimum-level} variables. | 251 | and @code{warning-minimum-level} variables. |
| 218 | 252 | ||
| 219 | @node Customizable variables | 253 | @node Customizable variables |
| 220 | @section Customizable variables | 254 | @section Customizable variables |
| 221 | @cindex Customizable variables | 255 | @cindex customizable variables |
| 256 | @cindex variables for customizing flymake | ||
| 222 | 257 | ||
| 223 | This section summarizes variables used for the configuration of the | 258 | This section summarizes customization variables used for the |
| 224 | Flymake user interface. | 259 | configuration of the Flymake user interface. |
| 225 | 260 | ||
| 226 | @table @code | 261 | @vtable @code |
| 227 | @item flymake-no-changes-timeout | 262 | @item flymake-no-changes-timeout |
| 228 | If any changes are made to the buffer, syntax check is automatically | 263 | If any changes are made to the buffer, syntax check is automatically |
| 229 | started after @code{flymake-no-changes-timeout} seconds. | 264 | started after this many seconds, unless the user makes another change, |
| 265 | which resets the timer. | ||
| 230 | 266 | ||
| 231 | @item flymake-start-syntax-check-on-newline | 267 | @item flymake-start-syntax-check-on-newline |
| 232 | A boolean flag indicating whether to start syntax check after a | 268 | A boolean flag indicating whether to start syntax check immediately |
| 233 | newline character is added to the buffer. | 269 | after a newline character is inserted into the buffer. |
| 270 | |||
| 271 | @item flymake-start-on-flymake-mode | ||
| 272 | A boolean flag indicating whether to start syntax check immediately | ||
| 273 | after enabling @code{flymake-mode}. | ||
| 234 | 274 | ||
| 235 | @item flymake-error | 275 | @item flymake-error |
| 236 | A custom face for highlighting regions for which an error has been | 276 | A custom face for highlighting regions for which an error has been |
| @@ -258,16 +298,406 @@ Which fringe (if any) should show the warning/error bitmaps. | |||
| 258 | @item flymake-wrap-around | 298 | @item flymake-wrap-around |
| 259 | If non-nil, moving to errors with @code{flymake-goto-next-error} and | 299 | If non-nil, moving to errors with @code{flymake-goto-next-error} and |
| 260 | @code{flymake-goto-prev-error} wraps around buffer boundaries. | 300 | @code{flymake-goto-prev-error} wraps around buffer boundaries. |
| 261 | 301 | @end vtable | |
| 262 | @end table | ||
| 263 | 302 | ||
| 264 | @node Extending Flymake | 303 | @node Extending Flymake |
| 265 | @chapter Extending Flymake | 304 | @chapter Extending Flymake |
| 266 | @cindex Extending Flymake | 305 | @cindex extending flymake |
| 306 | |||
| 307 | Flymake can primarily be extended in one of two ways: | ||
| 308 | |||
| 309 | @enumerate | ||
| 310 | @item | ||
| 311 | By changing the look and feel of the annotations produced by the | ||
| 312 | different backends. | ||
| 313 | |||
| 314 | @item | ||
| 315 | By adding a new buffer-checking backend. | ||
| 316 | @end enumerate | ||
| 317 | |||
| 318 | The following sections discuss each approach in detail. | ||
| 319 | |||
| 320 | @menu | ||
| 321 | * Flymake error types:: | ||
| 322 | * Backend functions:: | ||
| 323 | @end menu | ||
| 324 | |||
| 325 | @node Flymake error types | ||
| 326 | @section Customizing Flymake error types | ||
| 327 | @cindex customizing error types | ||
| 328 | @cindex error types, customization | ||
| 329 | |||
| 330 | @vindex flymake-diagnostic-types-alist | ||
| 331 | The variable @code{flymake-diagnostic-types-alist} is looked up by | ||
| 332 | Flymake every time an annotation for a diagnostic is created in the | ||
| 333 | buffer. Specifically, this variable holds a table of correspondence | ||
| 334 | between symbols designating diagnostic types and an additional | ||
| 335 | sub-table of properties pertaining to each diagnostic type. | ||
| 336 | |||
| 337 | Both tables are laid out in association list (@pxref{Association | ||
| 338 | Lists,,, elisp, The Emacs Lisp Reference Manual}) format, and thus can | ||
| 339 | be conveniently accessed with the functions of the @code{assoc} | ||
| 340 | family. | ||
| 341 | |||
| 342 | You can use any symbol-value association in the properties sub-table, | ||
| 343 | but some symbols have special meaning as to where and how Flymake | ||
| 344 | presents the diagnostic: | ||
| 345 | |||
| 346 | @itemize | ||
| 347 | |||
| 348 | @item | ||
| 349 | @cindex bitmap of diagnostic | ||
| 350 | @code{bitmap}, an image displayed in the fringe according to | ||
| 351 | @code{flymake-fringe-indicator-position}. The value actually follows | ||
| 352 | the syntax of @code{flymake-error-bitmap} (@pxref{Customizable | ||
| 353 | variables}). It is overridden by any @code{before-string} overlay | ||
| 354 | property. | ||
| 355 | |||
| 356 | @item | ||
| 357 | @cindex severity of diagnostic | ||
| 358 | @code{severity} is a non-negative integer specifying the diagnostic's | ||
| 359 | severity. The higher the value, the more serious is the error. If | ||
| 360 | the overlay property @code{priority} is not specified, @code{severity} | ||
| 361 | is used to set it and help sort overlapping overlays. | ||
| 362 | |||
| 363 | @item | ||
| 364 | Every property pertaining to overlays (@pxref{Overlay Properties,,, | ||
| 365 | elisp, The Emacs Lisp Reference Manual}), except @code{category} and | ||
| 366 | @code{evaporate}. These properties are used to affect the appearance | ||
| 367 | of Flymake annotations. | ||
| 368 | |||
| 369 | As an example, here's how to make errors (diagnostics of the type | ||
| 370 | @code{:error}) stand out even more prominently in the buffer, by | ||
| 371 | raising the characters using a @code{display} overlay property. | ||
| 372 | |||
| 373 | @example | ||
| 374 | (push '(display . (raise 1.2)) | ||
| 375 | (cdr (assoc :error flymake-diagnostic-types-alist))) | ||
| 376 | @end example | ||
| 377 | |||
| 378 | @item | ||
| 379 | @vindex flymake-category | ||
| 380 | @code{flymake-category} is a symbol whose property list is considered | ||
| 381 | the default for missing values of any other properties. | ||
| 382 | @end itemize | ||
| 383 | |||
| 384 | @cindex predefined diagnostic types | ||
| 385 | @vindex flymake-error | ||
| 386 | @vindex flymake-warning | ||
| 387 | @vindex flymake-note | ||
| 388 | Three default diagnostic types, @code{:error}, @code{:warning} and | ||
| 389 | @code{:note} are predefined in | ||
| 390 | @code{flymake-diagnostic-types-alist}. By default each lists a single | ||
| 391 | @code{flymake-category} property whose value is, respectively, the | ||
| 392 | symbols @code{flymake-error}, @code{flymake-warning} and | ||
| 393 | @code{flymake-note}. | ||
| 394 | |||
| 395 | These category symbols' plists is where the values of customizable | ||
| 396 | variables and faces such as @code{flymake-error-bitmap} are found. | ||
| 397 | Thus, if you change their plists, Flymake may stop honoring these | ||
| 398 | user customizations. | ||
| 399 | |||
| 400 | The @code{flymake-category} special property is also especially useful | ||
| 401 | for backends which create diagnostics objects with non-default | ||
| 402 | types that differ from an existing type by only a few properties | ||
| 403 | (@pxref{Flymake utility functions}). | ||
| 404 | |||
| 405 | As an example, consider configuring a new diagnostic type | ||
| 406 | @code{:low-priority-note} that behaves much like the @code{:note} | ||
| 407 | priority but without an overlay face. | ||
| 408 | |||
| 409 | @example | ||
| 410 | (add-to-list | ||
| 411 | 'flymake-diagnostic-types-alist | ||
| 412 | `(:low-priority-note . ((face . nil) | ||
| 413 | (flymake-category . flymake-note)))) | ||
| 414 | @end example | ||
| 415 | |||
| 416 | @vindex flymake-text | ||
| 417 | As you might have guessed, Flymake's annotations are implemented as | ||
| 418 | overlays (@pxref{Overlays,,, elisp, The Emacs Lisp Reference Manual}). | ||
| 419 | Along with the properties that you specify for the specific type of | ||
| 420 | diagnostic, Flymake adds the property @code{flymake-text} to these | ||
| 421 | overlays, and sets it to the message string that the backend used to | ||
| 422 | describe the diagnostic. | ||
| 423 | |||
| 424 | Since overlays also support arbitrary keymaps, you can use this | ||
| 425 | property @code{flymake-text} to create interactive annotations, such | ||
| 426 | as in the following example of binding a @kbd{mouse-3} event (middle | ||
| 427 | mouse button click) to an Internet search for the text of a | ||
| 428 | @code{:warning} or @code{:error}. | ||
| 429 | |||
| 430 | @example | ||
| 431 | (defun my-search-for-message (event) | ||
| 432 | (interactive "e") | ||
| 433 | (let ((ovs (overlays-at (posn-point (event-start event)))) | ||
| 434 | ov) | ||
| 435 | ;; loop until flymake overlay we clicked on is recovered | ||
| 436 | (while (not (overlay-get (setq ov (pop ovs)) 'flymake-text))) | ||
| 437 | (when ov | ||
| 438 | (eww-browse-url | ||
| 439 | (concat "https://duckduckgo.com/?q=" | ||
| 440 | (replace-regexp-in-string " " | ||
| 441 | "+" | ||
| 442 | (overlay-get ov 'flymake-text))) | ||
| 443 | t)))) | ||
| 444 | |||
| 445 | (dolist (type '(:warning :error)) | ||
| 446 | (let ((a (assoc type flymake-diagnostic-types-alist))) | ||
| 447 | (setf (cdr a) | ||
| 448 | (append `((mouse-face . highlight) | ||
| 449 | (keymap . ,(let ((map (make-sparse-keymap))) | ||
| 450 | (define-key map [mouse-2] | ||
| 451 | 'my-search-for-message) | ||
| 452 | map))) | ||
| 453 | (cdr a))))) | ||
| 454 | @end example | ||
| 455 | |||
| 456 | @node Backend functions | ||
| 457 | @section Backend functions | ||
| 458 | @cindex backend functions | ||
| 459 | |||
| 460 | @vindex flymake-diagnostic-functions | ||
| 461 | Flymake backends are Lisp functions placed in the special hook | ||
| 462 | @code{flymake-diagnostic-functions}. | ||
| 463 | |||
| 464 | A backend's responsibility is to diagnose the contents of a buffer for | ||
| 465 | problems, registering the problem's positions, type, and summary | ||
| 466 | description. This information is collected in the form of diagnostic | ||
| 467 | objects created by the function @code{flymake-make-diagnostic} | ||
| 468 | (@pxref{Flymake utility functions}), and | ||
| 469 | then handed over to Flymake, which proceeds to annotate the | ||
| 470 | buffer. | ||
| 471 | |||
| 472 | A request for a buffer check, and the subsequent delivery of | ||
| 473 | diagnostics, are two key events of the interaction between Flymake | ||
| 474 | and backend. Each such event corresponds to a well-defined function | ||
| 475 | calling convention: one for calls made by Flymake into the backend via | ||
| 476 | the backend function, the other in the reverse direction via a | ||
| 477 | callback. To be usable, backends must adhere to both. | ||
| 478 | |||
| 479 | Backend functions must accept an arbitrary number of arguments: | ||
| 480 | |||
| 481 | @itemize | ||
| 482 | @item | ||
| 483 | the first argument is always @var{report-fn}, a callback function | ||
| 484 | detailed below; | ||
| 485 | |||
| 486 | @item | ||
| 487 | the remaining arguments are keyword-value pairs of the | ||
| 488 | form @w{@code{(@var{:key} @var{value} @var{:key2} @var{value2}...)}}. Currently, | ||
| 489 | Flymake provides no such arguments, but backend functions must be | ||
| 490 | prepared to accept (and possibly ignore) any number of them. | ||
| 491 | @end itemize | ||
| 492 | |||
| 493 | Whenever Flymake or the user decide to re-check the buffer, backend | ||
| 494 | functions are called as detailed above, and are expected to initiate | ||
| 495 | this check, but aren't in any way required to complete it before | ||
| 496 | exiting: if the computation involved is expensive, as | ||
| 497 | is often the case with large buffers, that slower task should be | ||
| 498 | scheduled for the future using asynchronous sub-processes | ||
| 499 | (@pxref{Asynchronous Processes,,, elisp, The Emacs Lisp reference | ||
| 500 | manual}) or other asynchronous mechanisms. | ||
| 501 | |||
| 502 | In any case, backend functions are expected to return quickly or | ||
| 503 | signal an error, in which case the backend is disabled | ||
| 504 | (@pxref{Backend exceptions}). | ||
| 505 | |||
| 506 | If the function returns, Flymake considers the backend to be | ||
| 507 | @dfn{running}. If it has not done so already, the backend is expected | ||
| 508 | to call the function @var{report-fn} passed to it, at which point | ||
| 509 | Flymake considers the backend to be @dfn{reporting}. Backends call | ||
| 510 | @var{report-fn} by passing it a single argument @var{report-action} | ||
| 511 | followed by an optional list of keyword-value pairs of the form | ||
| 512 | @w{@code{(@var{:report-key} @var{value} @var{:report-key2} @var{value2}...)}}. | ||
| 513 | |||
| 514 | Currently accepted values for @var{report-action} are: | ||
| 515 | |||
| 516 | @itemize | ||
| 517 | @item | ||
| 518 | A (possibly empty) list of diagnostic objects created by | ||
| 519 | @code{flymake-make-diagnostic}, causing Flymake to annotate the | ||
| 520 | buffer with this information. | ||
| 521 | |||
| 522 | A backend may call @var{report-fn} repeatedly in this manner, but only | ||
| 523 | until Flymake considers that the most recently requested buffer check | ||
| 524 | is now obsolete, because, say, buffer contents have changed in the | ||
| 525 | meantime. The backend is only given notice of this via a renewed call | ||
| 526 | to the backend function. Thus, to prevent making obsolete reports and | ||
| 527 | wasting resources, backend functions should first cancel any ongoing | ||
| 528 | processing from previous calls. | ||
| 529 | |||
| 530 | @item | ||
| 531 | The symbol @code{:panic}, signaling that the backend has encountered | ||
| 532 | an exceptional situation and should be disabled. | ||
| 533 | @end itemize | ||
| 534 | |||
| 535 | Currently accepted @var{report-key} arguments are: | ||
| 536 | |||
| 537 | @itemize | ||
| 538 | @item | ||
| 539 | @code{:explanation}, whose value should give user-readable | ||
| 540 | details of the situation encountered, if any. | ||
| 541 | |||
| 542 | @item | ||
| 543 | @code{:force}, whose value should be a boolean suggesting | ||
| 544 | that Flymake consider the report even if it was somehow | ||
| 545 | unexpected. | ||
| 546 | @end itemize | ||
| 547 | |||
| 548 | @menu | ||
| 549 | * Flymake utility functions:: | ||
| 550 | * An annotated example backend:: | ||
| 551 | @end menu | ||
| 552 | |||
| 553 | @node Flymake utility functions | ||
| 554 | @subsection Flymake utility functions | ||
| 555 | @cindex utility functions | ||
| 556 | |||
| 557 | @cindex create diagnostic object | ||
| 558 | Before delivering them to Flymake, backends create diagnostic objects | ||
| 559 | by calling the function @code{flymake-make-diagnostic}. | ||
| 560 | |||
| 561 | @deffn Function flymake-make-diagnostic buffer beg end type text | ||
| 562 | Make a Flymake diagnostic for @var{buffer}'s region from @var{beg} to | ||
| 563 | @var{end}. @var{type} is a key to | ||
| 564 | @code{flymake-diagnostic-types-alist} and @var{text} is a description | ||
| 565 | of the problem detected in this region. | ||
| 566 | @end deffn | ||
| 567 | |||
| 568 | @cindex buffer position from line and column number | ||
| 569 | It is often the case with external syntax tools that a diagnostic's | ||
| 570 | position is reported in terms of a line number, and sometimes a column | ||
| 571 | number. To convert this information into a buffer position, backends | ||
| 572 | can use the following function: | ||
| 573 | |||
| 574 | @deffn Function flymake-diag-region buffer line &optional col | ||
| 575 | Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding to | ||
| 576 | @var{line} and @var{col}. If @var{col} is nil, return a region just | ||
| 577 | for @var{line}. Return nil if the region is invalid. | ||
| 578 | @end deffn | ||
| 579 | |||
| 580 | @cindex add a log message | ||
| 581 | For troubleshooting purposes, backends may record arbitrary | ||
| 582 | exceptional or erroneous situations into the Flymake log | ||
| 583 | buffer (@pxref{Backend exceptions}): | ||
| 584 | |||
| 585 | @deffn Macro flymake-log level msg &optional args | ||
| 586 | Log, at level @var{level}, the message @var{msg} formatted with | ||
| 587 | @var{args}. @var{level} is passed to @code{display-warning} | ||
| 588 | (@pxref{Warning Basics,,, elisp, The Emacs Lisp reference Manual}), which is | ||
| 589 | used to display the warning in Flymake's log buffer. | ||
| 590 | @end deffn | ||
| 591 | |||
| 592 | @node An annotated example backend | ||
| 593 | @subsection An annotated example backend | ||
| 594 | @cindex example of backend | ||
| 595 | @cindex backend, annotated example | ||
| 596 | |||
| 597 | This section presents an annotated example of a complete working | ||
| 598 | Flymake backend. The example illustrates the process of writing a | ||
| 599 | backend as outlined above. | ||
| 600 | |||
| 601 | The backend in question is used for checking Ruby source files. It | ||
| 602 | uses asynchronous sub-processes (@pxref{Asynchronous Processes,,, elisp, | ||
| 603 | The Emacs Lisp Reference Manual}), a common technique for performing | ||
| 604 | parallel processing in Emacs. | ||
| 605 | |||
| 606 | The following code needs lexical binding (@pxref{Using Lexical | ||
| 607 | Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. | ||
| 608 | |||
| 609 | @example | ||
| 610 | ;;; ruby-flymake.el --- A ruby Flymake backend -*- lexical-binding: t; -*- | ||
| 611 | (defvar-local ruby--flymake-proc nil) | ||
| 612 | |||
| 613 | (defun ruby-flymake (report-fn &rest _args) | ||
| 614 | ;; Not having a ruby interpreter is a serious problem which should cause | ||
| 615 | ;; the backend to disable itself, so an @code{error} is signalled. | ||
| 616 | ;; | ||
| 617 | (unless (executable-find | ||
| 618 | "ruby") (error "Cannot find a suitable ruby")) | ||
| 619 | ;; If a live process launched in an earlier check was found, that | ||
| 620 | ;; process is killed. When that process's sentinel eventually runs, | ||
| 621 | ;; it will notice its obsoletion, since it have since reset | ||
| 622 | ;; `ruby-flymake-proc' to a different value | ||
| 623 | ;; | ||
| 624 | (when (process-live-p ruby--flymake-proc) | ||
| 625 | (kill-process ruby--flymake-proc)) | ||
| 626 | |||
| 627 | ;; Save the current buffer, the narrowing restriction, remove any | ||
| 628 | ;; narrowing restriction. | ||
| 629 | ;; | ||
| 630 | (let ((source (current-buffer))) | ||
| 631 | (save-restriction | ||
| 632 | (widen) | ||
| 633 | ;; Reset the `ruby--flymake-proc' process to a new process | ||
| 634 | ;; calling the ruby tool. | ||
| 635 | ;; | ||
| 636 | (setq | ||
| 637 | ruby--flymake-proc | ||
| 638 | (make-process | ||
| 639 | :name "ruby-flymake" :noquery t :connection-type 'pipe | ||
| 640 | ;; Make output go to a temporary buffer. | ||
| 641 | ;; | ||
| 642 | :buffer (generate-new-buffer " *ruby-flymake*") | ||
| 643 | :command '("ruby" "-w" "-c") | ||
| 644 | :sentinel | ||
| 645 | (lambda (proc _event) | ||
| 646 | ;; Check that the process has indeed exited, as it might | ||
| 647 | ;; be simply suspended. | ||
| 648 | ;; | ||
| 649 | (when (eq 'exit (process-status proc)) | ||
| 650 | (unwind-protect | ||
| 651 | ;; Only proceed if `proc' is the same as | ||
| 652 | ;; `ruby--flymake-proc', which indicates that | ||
| 653 | ;; `proc' is not an obsolete process. | ||
| 654 | ;; | ||
| 655 | (if (eq proc ruby--flymake-proc) | ||
| 656 | (with-current-buffer (process-buffer proc) | ||
| 657 | (goto-char (point-min)) | ||
| 658 | ;; Parse the output buffer for diagnostic's | ||
| 659 | ;; messages and locations, collect them in a list | ||
| 660 | ;; of objects, and call `report-fn'. | ||
| 661 | ;; | ||
| 662 | (cl-loop | ||
| 663 | while (search-forward-regexp | ||
| 664 | "^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" | ||
| 665 | nil t) | ||
| 666 | for msg = (match-string 2) | ||
| 667 | for (beg . end) = (flymake-diag-region | ||
| 668 | source | ||
| 669 | (string-to-number (match-string 1))) | ||
| 670 | for type = (if (string-match "^warning" msg) | ||
| 671 | :warning | ||
| 672 | :error) | ||
| 673 | collect (flymake-make-diagnostic source | ||
| 674 | beg | ||
| 675 | end | ||
| 676 | type | ||
| 677 | msg) | ||
| 678 | into diags | ||
| 679 | finally (funcall report-fn diags))) | ||
| 680 | (flymake-log :warning "Cancelling obsolete check %s" | ||
| 681 | proc)) | ||
| 682 | ;; Cleanup the temporary buffer used to hold the | ||
| 683 | ;; check's output. | ||
| 684 | ;; | ||
| 685 | (kill-buffer (process-buffer proc))))))) | ||
| 686 | ;; Send the buffer contents to the process's stdin, followed by | ||
| 687 | ;; an EOF. | ||
| 688 | ;; | ||
| 689 | (process-send-region ruby--flymake-proc (point-min) (point-max)) | ||
| 690 | (process-send-eof ruby--flymake-proc)))) | ||
| 691 | |||
| 692 | (defun ruby-setup-flymake-backend () | ||
| 693 | (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t)) | ||
| 694 | |||
| 695 | (add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend) | ||
| 696 | @end example | ||
| 267 | 697 | ||
| 268 | @node The legacy Proc backend | 698 | @node The legacy Proc backend |
| 269 | @chapter The legacy ``Proc'' backend | 699 | @chapter The legacy ``Proc'' backend |
| 270 | @cindex The legacy Proc backend | 700 | @cindex legacy proc backend |
| 271 | 701 | ||
| 272 | @menu | 702 | @menu |
| 273 | * Proc customization variables:: | 703 | * Proc customization variables:: |
| @@ -282,15 +712,16 @@ If non-nil, moving to errors with @code{flymake-goto-next-error} and | |||
| 282 | * Interaction with other modes:: | 712 | * Interaction with other modes:: |
| 283 | @end menu | 713 | @end menu |
| 284 | 714 | ||
| 715 | @findex flymake-proc-legacy-backend | ||
| 285 | The backend @code{flymake-proc-legacy-backend} was originally designed | 716 | The backend @code{flymake-proc-legacy-backend} was originally designed |
| 286 | to be extended for supporting new syntax check tools and error message | 717 | to be extended for supporting new syntax check tools and error message |
| 287 | patterns. It is also controlled by its own set of customization variables | 718 | patterns. It is also controlled by its own set of customization variables |
| 288 | 719 | ||
| 289 | @node Proc customization variables | 720 | @node Proc customization variables |
| 290 | @section Customization variables for the Proc backend | 721 | @section Customization variables for the Proc backend |
| 291 | @cindex Proc customization variables | 722 | @cindex proc backend customization variables |
| 292 | 723 | ||
| 293 | @table @code | 724 | @vtable @code |
| 294 | @item flymake-proc-allowed-file-name-masks | 725 | @item flymake-proc-allowed-file-name-masks |
| 295 | A list of @code{(filename-regexp, init-function, cleanup-function | 726 | A list of @code{(filename-regexp, init-function, cleanup-function |
| 296 | getfname-function)} for configuring syntax check tools. @xref{Adding | 727 | getfname-function)} for configuring syntax check tools. @xref{Adding |
| @@ -314,22 +745,22 @@ line-idx col-idx err-text-idx)}. @xref{Parsing the output}. | |||
| 314 | 745 | ||
| 315 | @item flymake-proc-diagnostic-type-pred | 746 | @item flymake-proc-diagnostic-type-pred |
| 316 | A function to classify a diagnostic text as particular type of | 747 | A function to classify a diagnostic text as particular type of |
| 317 | error. Should be a function taking an error text and returning one of | 748 | error. Should be a function taking an error text and returning one of |
| 318 | the symbols indexing @code{flymake-diagnostic-types-alist}. If non-nil | 749 | the symbols indexing @code{flymake-diagnostic-types-alist}. If non-nil |
| 319 | is returned but there is no such symbol in that table, a warning is | 750 | is returned but there is no such symbol in that table, a warning is |
| 320 | assumed. If nil is returned, an error is assumed. Can also be a | 751 | assumed. If nil is returned, an error is assumed. Can also be a |
| 321 | regular expression that should match only warnings. This variable | 752 | regular expression that should match only warnings. This variable |
| 322 | replaces the old @code{flymake-warning-re} and | 753 | replaces the old @code{flymake-warning-re} and |
| 323 | @code{flymake-warning-predicate}. | 754 | @code{flymake-warning-predicate}. |
| 324 | 755 | ||
| 325 | @item flymake-proc-compilation-prevents-syntax-check | 756 | @item flymake-proc-compilation-prevents-syntax-check |
| 326 | A flag indicating whether compilation and syntax check of the same | 757 | A flag indicating whether compilation and syntax check of the same |
| 327 | file cannot be run simultaneously. | 758 | file cannot be run simultaneously. @xref{Interaction with other modes}. |
| 328 | @end table | 759 | @end vtable |
| 329 | 760 | ||
| 330 | @node Adding support for a new syntax check tool | 761 | @node Adding support for a new syntax check tool |
| 331 | @section Adding support for a new syntax check tool | 762 | @section Adding support for a new syntax check tool |
| 332 | @cindex Adding support for a new syntax check tool | 763 | @cindex adding support for a new syntax check tool |
| 333 | 764 | ||
| 334 | @menu | 765 | @menu |
| 335 | * Example---Configuring a tool called directly:: | 766 | * Example---Configuring a tool called directly:: |
| @@ -371,10 +802,9 @@ will be different from the real ones, as actually the tool works with | |||
| 371 | the temporary copy. In most cases, the default implementation | 802 | the temporary copy. In most cases, the default implementation |
| 372 | provided by Flymake, @code{flymake-proc-get-real-file-name}, can be | 803 | provided by Flymake, @code{flymake-proc-get-real-file-name}, can be |
| 373 | used as @code{getfname-function}. | 804 | used as @code{getfname-function}. |
| 374 | |||
| 375 | @end table | 805 | @end table |
| 376 | 806 | ||
| 377 | To add support for a new syntax check tool, write corresponding | 807 | To add support for a new syntax check tool, write the corresponding |
| 378 | @code{init-function} and, optionally, @code{cleanup-function} and | 808 | @code{init-function} and, optionally, @code{cleanup-function} and |
| 379 | @code{getfname-function}. If the format of error messages reported by | 809 | @code{getfname-function}. If the format of error messages reported by |
| 380 | the new tool is not yet supported by Flymake, add a new entry to | 810 | the new tool is not yet supported by Flymake, add a new entry to |
| @@ -385,10 +815,10 @@ support for various syntax check tools. | |||
| 385 | 815 | ||
| 386 | @node Example---Configuring a tool called directly | 816 | @node Example---Configuring a tool called directly |
| 387 | @subsection Example---Configuring a tool called directly | 817 | @subsection Example---Configuring a tool called directly |
| 388 | @cindex Adding support for perl | 818 | @cindex adding support for perl |
| 389 | 819 | ||
| 390 | In this example, we will add support for @code{perl} as a syntax check | 820 | In this example, we will add support for @command{perl} as a syntax check |
| 391 | tool. @code{perl} supports the @code{-c} option which does syntax | 821 | tool. @command{perl} supports the @option{-c} option which does syntax |
| 392 | checking. | 822 | checking. |
| 393 | 823 | ||
| 394 | First, we write the @code{init-function}: | 824 | First, we write the @code{init-function}: |
| @@ -434,7 +864,7 @@ Finally, we add an entry to @code{flymake-proc-err-line-patterns}: | |||
| 434 | 864 | ||
| 435 | @node Example---Configuring a tool called via make | 865 | @node Example---Configuring a tool called via make |
| 436 | @subsection Example---Configuring a tool called via make | 866 | @subsection Example---Configuring a tool called via make |
| 437 | @cindex Adding support for C (gcc+make) | 867 | @cindex adding support for C (gcc+make) |
| 438 | 868 | ||
| 439 | In this example we will add support for C files syntax checked by | 869 | In this example we will add support for C files syntax checked by |
| 440 | @command{gcc} called via @command{make}. | 870 | @command{gcc} called via @command{make}. |
| @@ -464,9 +894,10 @@ command line: | |||
| 464 | "check-syntax")) | 894 | "check-syntax")) |
| 465 | @end lisp | 895 | @end lisp |
| 466 | 896 | ||
| 467 | @code{base-dir} is a directory containing @code{Makefile}, see @ref{Locating the buildfile}. | 897 | @code{base-dir} is a directory containing the @file{Makefile}, see |
| 898 | @ref{Locating the buildfile}. | ||
| 468 | 899 | ||
| 469 | Thus, @code{Makefile} must contain the @code{check-syntax} target. In | 900 | Thus, @file{Makefile} must contain the @code{check-syntax} target. In |
| 470 | our case this target might look like this: | 901 | our case this target might look like this: |
| 471 | 902 | ||
| 472 | @verbatim | 903 | @verbatim |
| @@ -488,11 +919,11 @@ check-syntax: | |||
| 488 | 919 | ||
| 489 | @node Implementation overview | 920 | @node Implementation overview |
| 490 | @section Implementation overview | 921 | @section Implementation overview |
| 491 | @cindex Syntax check models | 922 | @cindex syntax check models |
| 492 | @cindex Master file | 923 | @cindex master file |
| 493 | 924 | ||
| 494 | @code{flymake-proc-legacy-backend} saves a copy of the buffer in a | 925 | @code{flymake-proc-legacy-backend} saves a copy of the buffer in a |
| 495 | temporary file in the buffer's directory (or in the system temp | 926 | temporary file in the buffer's directory (or in the system temporary |
| 496 | directory, for Java files), creates a syntax check command and | 927 | directory, for Java files), creates a syntax check command and |
| 497 | launches a process with this command. The output is parsed using a | 928 | launches a process with this command. The output is parsed using a |
| 498 | list of error message patterns, and error information (file name, line | 929 | list of error message patterns, and error information (file name, line |
| @@ -511,15 +942,15 @@ Two syntax check modes are distinguished: | |||
| 511 | @item | 942 | @item |
| 512 | Buffer can be syntax checked in a standalone fashion, that is, the | 943 | Buffer can be syntax checked in a standalone fashion, that is, the |
| 513 | file (its temporary copy, in fact) can be passed over to the compiler to | 944 | file (its temporary copy, in fact) can be passed over to the compiler to |
| 514 | do the syntax check. Examples are C/C++ (.c, .cpp) and Java (.java) | 945 | do the syntax check. Examples are C/C@t{++} sources (@file{.c}, |
| 515 | sources. | 946 | @file{.cpp}) and Java (@file{.java}). |
| 516 | 947 | ||
| 517 | @item | 948 | @item |
| 518 | Buffer can be syntax checked, but additional file, called master file, | 949 | Buffer can be syntax checked, but additional file, called master file, |
| 519 | is required to perform this operation. A master file is a file that | 950 | is required to perform this operation. A master file is a file that |
| 520 | includes the current file, so that running a syntax check tool on it | 951 | includes the current file, so that running a syntax check tool on it |
| 521 | will also check syntax in the current file. Examples are C/C++ (.h, | 952 | will also check syntax in the current file. Examples are C/C@t{++} |
| 522 | .hpp) headers. | 953 | headers (@file{.h}, @file{.hpp}). |
| 523 | 954 | ||
| 524 | @end enumerate | 955 | @end enumerate |
| 525 | 956 | ||
| @@ -534,8 +965,7 @@ tool-specific (routines for Make, Ant, etc.)@: code. | |||
| 534 | 965 | ||
| 535 | @node Making a temporary copy | 966 | @node Making a temporary copy |
| 536 | @section Making a temporary copy | 967 | @section Making a temporary copy |
| 537 | @cindex Temporary copy of the buffer | 968 | @cindex temporary copy of the buffer |
| 538 | @cindex Master file | ||
| 539 | 969 | ||
| 540 | After the possibility of the syntax check has been determined, a | 970 | After the possibility of the syntax check has been determined, a |
| 541 | temporary copy of the current buffer is made so that the most recent | 971 | temporary copy of the current buffer is made so that the most recent |
| @@ -547,9 +977,10 @@ Things get trickier, however, when master file is involved, as it | |||
| 547 | requires to | 977 | requires to |
| 548 | 978 | ||
| 549 | @itemize @bullet | 979 | @itemize @bullet |
| 550 | @item locate a master file | 980 | @item |
| 551 | @item patch it to include the current file using its new (temporary) | 981 | locate a master file |
| 552 | name. | 982 | @item |
| 983 | patch it to include the current file using its new (temporary) name. | ||
| 553 | @end itemize | 984 | @end itemize |
| 554 | 985 | ||
| 555 | Locating a master file is discussed in the following section. | 986 | Locating a master file is discussed in the following section. |
| @@ -565,37 +996,39 @@ the syntax check tool. | |||
| 565 | 996 | ||
| 566 | @node Locating a master file | 997 | @node Locating a master file |
| 567 | @section Locating a master file | 998 | @section Locating a master file |
| 568 | @cindex Master file | 999 | @cindex locating a master file |
| 1000 | @cindex master file, locating | ||
| 569 | 1001 | ||
| 570 | Master file is located in two steps. | 1002 | Master file is located in two steps. |
| 571 | 1003 | ||
| 572 | First, a list of possible master files is built. A simple name | 1004 | First, a list of possible master files is built. A simple name |
| 573 | matching is used to find the files. For a C++ header @code{file.h}, | 1005 | matching is used to find the files. For a C++ header @file{file.h}, |
| 574 | the Proc backend searches for all @code{.cpp} files in the directories | 1006 | the Proc backend searches for all @file{.cpp} files in the directories |
| 575 | whose relative paths are stored in a customizable variable | 1007 | whose relative paths are stored in a customizable variable |
| 576 | @code{flymake-proc-master-file-dirs}, which usually contains something | 1008 | @code{flymake-proc-master-file-dirs}, which usually contains something |
| 577 | like @code{("." "./src")}. No more than | 1009 | like @code{("." "./src")}. No more than |
| 578 | @code{flymake-proc-master-file-count-limit} entries is added to the | 1010 | @code{flymake-proc-master-file-count-limit} entries is added to the |
| 579 | master file list. The list is then sorted to move files with names | 1011 | master file list. The list is then sorted to move files with names |
| 580 | @code{file.cpp} to the top. | 1012 | @file{file.cpp} to the top. |
| 581 | 1013 | ||
| 582 | Next, each master file in a list is checked to contain the appropriate | 1014 | Next, each master file in a list is checked to contain the appropriate |
| 583 | include directives. No more than @code{flymake-proc-check-file-limit} of each | 1015 | include directives. No more than @code{flymake-proc-check-file-limit} of each |
| 584 | file are parsed. | 1016 | file are parsed. |
| 585 | 1017 | ||
| 586 | For @code{file.h}, the include directives to look for are | 1018 | For @file{file.h}, the include directives to look for are |
| 587 | @code{#include "file.h"}, @code{#include "../file.h"}, etc. Each | 1019 | @code{#include "file.h"}, @code{#include "../file.h"}, etc. Each |
| 588 | include is checked against a list of include directories | 1020 | include is checked against a list of include directories |
| 589 | (see @ref{Getting the include directories}) to be sure it points to the | 1021 | (see @ref{Getting the include directories}) to be sure it points to the |
| 590 | correct @code{file.h}. | 1022 | correct @file{file.h}. |
| 591 | 1023 | ||
| 592 | First matching master file found stops the search. The master file is then | 1024 | First matching master file found stops the search. The master file is then |
| 593 | patched and saved to disk. In case no master file is found, syntax check is | 1025 | patched and saved to disk. In case no master file is found, syntax check is |
| 594 | aborted, and corresponding status (!) is reported in the mode line. | 1026 | aborted, and corresponding status (@samp{!}) is reported in the mode line. |
| 1027 | @xref{Syntax check statuses}. | ||
| 595 | 1028 | ||
| 596 | @node Getting the include directories | 1029 | @node Getting the include directories |
| 597 | @section Getting the include directories | 1030 | @section Getting the include directories |
| 598 | @cindex Include directories (C/C++ specific) | 1031 | @cindex include directories (C/C++ specific) |
| 599 | 1032 | ||
| 600 | Two sets of include directories are distinguished: system include directories | 1033 | Two sets of include directories are distinguished: system include directories |
| 601 | and project include directories. The former is just the contents of the | 1034 | and project include directories. The former is just the contents of the |
| @@ -615,25 +1048,26 @@ of every syntax check attempt. | |||
| 615 | 1048 | ||
| 616 | @node Locating the buildfile | 1049 | @node Locating the buildfile |
| 617 | @section Locating the buildfile | 1050 | @section Locating the buildfile |
| 618 | @cindex Locating the buildfile | 1051 | @cindex locating the buildfile |
| 619 | @cindex buildfile, locating | 1052 | @cindex buildfile, locating |
| 620 | @cindex Makefile, locating | 1053 | @cindex Makefile, locating |
| 621 | 1054 | ||
| 622 | The Proc backend can be configured to use different tools for | 1055 | The Proc backend can be configured to use different tools for |
| 623 | performing syntax checks. For example, it can use direct compiler | 1056 | performing syntax checks. For example, it can use direct compiler |
| 624 | call to syntax check a perl script or a call to @command{make} for a | 1057 | call to syntax check a perl script or a call to @command{make} for a |
| 625 | more complicated case of a @code{C/C++} source. The general idea is | 1058 | more complicated case of a C/C@t{++} source. The general idea is |
| 626 | that simple files, like perl scripts and html pages, can be checked by | 1059 | that simple files, like Perl scripts and @acronym{HTML} pages, can be checked by |
| 627 | directly invoking a corresponding tool. Files that are usually more | 1060 | directly invoking a corresponding tool. Files that are usually more |
| 628 | complex and generally used as part of larger projects, might require | 1061 | complex and generally used as part of larger projects, might require |
| 629 | non-trivial options to be passed to the syntax check tool, like | 1062 | non-trivial options to be passed to the syntax check tool, like |
| 630 | include directories for C++. The latter files are syntax checked | 1063 | include directories for C@t{++}. The latter files are syntax checked |
| 631 | using some build tool, like Make or Ant. | 1064 | using some build tool, like Make or Ant. |
| 632 | 1065 | ||
| 633 | All Make configuration data is usually stored in a file called | 1066 | All Make configuration data is usually stored in a file called |
| 634 | @code{Makefile}. To allow for future extensions, Flymake uses a notion of | 1067 | @file{Makefile}. To allow for future extensions, Flymake uses a notion of |
| 635 | buildfile to reference the 'project configuration' file. | 1068 | buildfile to reference the @dfn{project configuration} file. |
| 636 | 1069 | ||
| 1070 | @findex flymake-proc-find-buildfile | ||
| 637 | Special function, @code{flymake-proc-find-buildfile} is provided for locating buildfiles. | 1071 | Special function, @code{flymake-proc-find-buildfile} is provided for locating buildfiles. |
| 638 | Searching for a buildfile is done in a manner similar to that of searching | 1072 | Searching for a buildfile is done in a manner similar to that of searching |
| 639 | for possible master files. | 1073 | for possible master files. |
| @@ -642,13 +1076,13 @@ A customizable variable | |||
| 642 | @code{flymake-proc-buildfile-dirs} holds a list of relative paths to the | 1076 | @code{flymake-proc-buildfile-dirs} holds a list of relative paths to the |
| 643 | buildfile. They are checked sequentially until a buildfile is found. | 1077 | buildfile. They are checked sequentially until a buildfile is found. |
| 644 | @end ignore | 1078 | @end ignore |
| 645 | In case there's no build file, syntax check is aborted. | 1079 | In case there's no build file, the syntax check is aborted. |
| 646 | 1080 | ||
| 647 | Buildfile values are also cached. | 1081 | Buildfile values are also cached. |
| 648 | 1082 | ||
| 649 | @node Starting the syntax check process | 1083 | @node Starting the syntax check process |
| 650 | @section Starting the syntax check process | 1084 | @section Starting the syntax check process |
| 651 | @cindex Syntax check process | 1085 | @cindex syntax check process, legacy proc backend |
| 652 | 1086 | ||
| 653 | The command line (command name and the list of arguments) for | 1087 | The command line (command name and the list of arguments) for |
| 654 | launching a process is returned by the initialization function. The | 1088 | launching a process is returned by the initialization function. The |
| @@ -659,16 +1093,16 @@ be killed without prompting the user. | |||
| 659 | 1093 | ||
| 660 | @node Parsing the output | 1094 | @node Parsing the output |
| 661 | @section Parsing the output | 1095 | @section Parsing the output |
| 662 | @cindex Parsing the output | 1096 | @cindex parsing the output, legacy proc backend |
| 663 | 1097 | ||
| 664 | The output generated by the syntax check tool is parsed in the process | 1098 | The output generated by the syntax check tool is parsed in the process |
| 665 | filter/sentinel using the error message patterns stored in the | 1099 | filter/sentinel using the error message patterns stored in the |
| 666 | @code{flymake-proc-err-line-patterns} variable. This variable contains a | 1100 | @code{flymake-proc-err-line-patterns} variable. This variable contains a |
| 667 | list of items of the form @code{(regexp file-idx line-idx | 1101 | list of items of the form @w{@code{(regexp file-idx line-idx |
| 668 | err-text-idx)}, used to determine whether a particular line is an | 1102 | err-text-idx)}}, used to determine whether a particular line is an |
| 669 | error message and extract file name, line number and error text, | 1103 | error message and extract file name, line number and error text, |
| 670 | respectively. Error type (error/warning) is also guessed by matching | 1104 | respectively. Error type (error/warning) is also guessed by matching |
| 671 | error text with the '@code{^[wW]arning}' pattern. Anything that was not | 1105 | error text with the @samp{^[wW]arning} pattern. Anything that was not |
| 672 | classified as a warning is considered an error. Type is then used to | 1106 | classified as a warning is considered an error. Type is then used to |
| 673 | sort error menu items, which shows error messages first. | 1107 | sort error menu items, which shows error messages first. |
| 674 | 1108 | ||
| @@ -676,7 +1110,7 @@ The Proc backend is also able to interpret error message patterns | |||
| 676 | missing err-text-idx information. This is done by merely taking the | 1110 | missing err-text-idx information. This is done by merely taking the |
| 677 | rest of the matched line (@code{(substring line (match-end 0))}) as | 1111 | rest of the matched line (@code{(substring line (match-end 0))}) as |
| 678 | error text. This trick allows making use of a huge collection of | 1112 | error text. This trick allows making use of a huge collection of |
| 679 | error message line patterns from @code{compile.el}. All these error | 1113 | error message line patterns from @file{compile.el}. All these error |
| 680 | patterns are appended to the end of | 1114 | patterns are appended to the end of |
| 681 | @code{flymake-proc-err-line-patterns}. | 1115 | @code{flymake-proc-err-line-patterns}. |
| 682 | 1116 | ||
| @@ -687,8 +1121,8 @@ after every process launch/exit. | |||
| 687 | 1121 | ||
| 688 | @node Interaction with other modes | 1122 | @node Interaction with other modes |
| 689 | @section Interaction with other modes | 1123 | @section Interaction with other modes |
| 690 | @cindex Interaction with other modes | 1124 | @cindex interaction with other modes, legacy proc backend |
| 691 | @cindex Interaction with compile mode | 1125 | @cindex interaction with compile mode, legacy proc backend |
| 692 | 1126 | ||
| 693 | The only mode the Proc backend currently knows about is | 1127 | The only mode the Proc backend currently knows about is |
| 694 | @code{compile}. | 1128 | @code{compile}. |
| @@ -702,8 +1136,9 @@ though, was working around a locking problem with MS Visual C++ | |||
| 702 | compiler. The variable in question is | 1136 | compiler. The variable in question is |
| 703 | @code{flymake-proc-compilation-prevents-syntax-check}. | 1137 | @code{flymake-proc-compilation-prevents-syntax-check}. |
| 704 | 1138 | ||
| 1139 | @findex flymake-proc-compile | ||
| 705 | The Proc backend also provides an alternative command for starting | 1140 | The Proc backend also provides an alternative command for starting |
| 706 | compilation, @code{flymake-proc-compile}. It just kills all the active | 1141 | compilation, @code{flymake-proc-compile}. It just kills all the active |
| 707 | syntax check processes before calling @code{compile}. | 1142 | syntax check processes before calling @code{compile}. |
| 708 | 1143 | ||
| 709 | @node GNU Free Documentation License | 1144 | @node GNU Free Documentation License |
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index a04fa43a776..f7fe5392ce5 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi | |||
| @@ -825,7 +825,7 @@ with a class of @code{t} is considered to match any class you specify. | |||
| 825 | This matches Emacs's behavior when deciding on which face attributes to | 825 | This matches Emacs's behavior when deciding on which face attributes to |
| 826 | use, to the best of my understanding ). | 826 | use, to the best of my understanding ). |
| 827 | 827 | ||
| 828 | If @var{class} is @code{nil}, then you just get get whatever | 828 | If @var{class} is @code{nil}, then you just get whatever |
| 829 | @code{face-attr-construct} returns; i.e., the current specification in | 829 | @code{face-attr-construct} returns; i.e., the current specification in |
| 830 | effect for @var{face}. | 830 | effect for @var{face}. |
| 831 | 831 | ||
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi index fc79b027a1d..5f9a0f59721 100644 --- a/doc/misc/ses.texi +++ b/doc/misc/ses.texi | |||
| @@ -584,7 +584,7 @@ This example will: | |||
| 584 | When the cell is empty (ie.@: when @code{val} is @code{nil}), print an | 584 | When the cell is empty (ie.@: when @code{val} is @code{nil}), print an |
| 585 | empty string @code{""} | 585 | empty string @code{""} |
| 586 | @item | 586 | @item |
| 587 | When the cell value is a non negative number, format the the value in | 587 | When the cell value is a non negative number, format the value in |
| 588 | fixed-point notation with one decimal after point | 588 | fixed-point notation with one decimal after point |
| 589 | @item | 589 | @item |
| 590 | Otherwise, handle the value as erroneous by printing it as an | 590 | Otherwise, handle the value as erroneous by printing it as an |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 6478479c38d..47055793b73 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -186,7 +186,7 @@ transparency extends to editing, version control, and @code{dired}. | |||
| 186 | @value{tramp} can access remote hosts using any number of access | 186 | @value{tramp} can access remote hosts using any number of access |
| 187 | methods, such as @command{rsh}, @command{rlogin}, @command{telnet}, | 187 | methods, such as @command{rsh}, @command{rlogin}, @command{telnet}, |
| 188 | and related programs. If these programs can successfully pass | 188 | and related programs. If these programs can successfully pass |
| 189 | @acronym{ASCII]} characters, @value{tramp} can use them. | 189 | @acronym{ASCII} characters, @value{tramp} can use them. |
| 190 | @value{tramp} does not require or mandate 8-bit clean connections. | 190 | @value{tramp} does not require or mandate 8-bit clean connections. |
| 191 | 191 | ||
| 192 | @value{tramp}'s most common access method is through @command{ssh}, a | 192 | @value{tramp}'s most common access method is through @command{ssh}, a |
| @@ -339,8 +339,8 @@ Another way is to follow the terminal session below: | |||
| 339 | 339 | ||
| 340 | @example | 340 | @example |
| 341 | @group | 341 | @group |
| 342 | ] @strong{cd ~/emacs} | 342 | $ cd ~/emacs |
| 343 | ] @strong{git clone git://git.savannah.gnu.org/tramp.git} | 343 | $ git clone git://git.savannah.gnu.org/tramp.git |
| 344 | @end group | 344 | @end group |
| 345 | @end example | 345 | @end example |
| 346 | 346 | ||
| @@ -349,8 +349,8 @@ From behind a firewall: | |||
| 349 | 349 | ||
| 350 | @example | 350 | @example |
| 351 | @group | 351 | @group |
| 352 | ] @strong{git config --global http.proxy http://user:pwd@@proxy.server.com:8080} | 352 | $ git config --global http.proxy http://user:pwd@@proxy.server.com:8080 |
| 353 | ] @strong{git clone https://git.savannah.gnu.org/r/tramp.git} | 353 | $ git clone https://git.savannah.gnu.org/r/tramp.git |
| 354 | @end group | 354 | @end group |
| 355 | @end example | 355 | @end example |
| 356 | 356 | ||
| @@ -358,7 +358,7 @@ From behind a firewall: | |||
| 358 | @value{tramp} developers: | 358 | @value{tramp} developers: |
| 359 | 359 | ||
| 360 | @example | 360 | @example |
| 361 | ] @strong{git clone login@@git.sv.gnu.org:/srv/git/tramp.git} | 361 | $ git clone login@@git.sv.gnu.org:/srv/git/tramp.git |
| 362 | @end example | 362 | @end example |
| 363 | 363 | ||
| 364 | @noindent | 364 | @noindent |
| @@ -370,8 +370,8 @@ To fetch updates from the repository, use git pull: | |||
| 370 | 370 | ||
| 371 | @example | 371 | @example |
| 372 | @group | 372 | @group |
| 373 | ] @strong{cd ~/emacs/tramp} | 373 | $ cd ~/emacs/tramp |
| 374 | ] @strong{git pull} | 374 | $ git pull |
| 375 | @end group | 375 | @end group |
| 376 | @end example | 376 | @end example |
| 377 | 377 | ||
| @@ -381,8 +381,8 @@ Run @command{autoconf} as follows to generate an up-to-date | |||
| 381 | 381 | ||
| 382 | @example | 382 | @example |
| 383 | @group | 383 | @group |
| 384 | ] @strong{cd ~/emacs/tramp} | 384 | $ cd ~/emacs/tramp |
| 385 | ] @strong{autoconf} | 385 | $ autoconf |
| 386 | @end group | 386 | @end group |
| 387 | @end example | 387 | @end example |
| 388 | 388 | ||
| @@ -2000,7 +2000,7 @@ fi | |||
| 2000 | install and execute a listener as follows (see @code{tramp-methods}): | 2000 | install and execute a listener as follows (see @code{tramp-methods}): |
| 2001 | 2001 | ||
| 2002 | @example | 2002 | @example |
| 2003 | # nc -l -p 42 | 2003 | $ nc -l -p 42 |
| 2004 | @end example | 2004 | @end example |
| 2005 | 2005 | ||
| 2006 | The above command-line syntax has changed with @command{busybox} | 2006 | The above command-line syntax has changed with @command{busybox} |