]> git.eshelyaron.com Git - emacs.git/commit
Completely rewrite Flymake's subprocess output processing
authorJoão Távora <joaotavora@gmail.com>
Wed, 23 Aug 2017 01:23:41 +0000 (02:23 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 3 Oct 2017 12:49:04 +0000 (13:49 +0100)
commit6954270e87e3a9f829cd6e8c89febc2c0bc48845
treef7290886640c847781e3fe7fb947f47015e9e373
parentf1601bef93a23ecd5092d9360a48e2288d835886
Completely rewrite Flymake's subprocess output processing

Instead of parsing and matching regexps line-by-line, insert
subprocess output in a separate buffer and parse using
`search-forward-regexp'.  This eventually enables multi-line error
patterns and simplifies code all around.  Store per-check information
in the subprocess using `process-get' and `process-put'.  Treat error
messages, warnings, etc. more generically as "diagnostics".  Create
these objects as soon as possible, reusing existing `flymake-ler'
structure.  Fix some whitespace.

* lisp/progmodes/flymake.el (cl-lib): Require also when
loading.
(flymake--fix-line-numbers): Rename from
flymake-fix-line-numbers.  Simplify.
(flymake-report): Call flymake--fix-line-numbers.  Rearrange
plain diagnostics list into alist format expected by
flymake-highlight-err-lines.

* lisp/progmodes/flymake-proc.el (flymake-process-filter): Insert
process output and parse in dedicated output buffer.
(flymake-proc--diagnostics-for-pattern): New helper function.
(flymake-process-sentinel): Call flymake-post-syntax-check with
collected diagnostics.  Kill output buffer.
(flymake-post-syntax-check): Receive diagnostics as third argument.
(flymake-parse-output-and-residual, flymake-new-err-info)
(flymake-parse-residual, flymake-parse-err-lines)
(flymake-split-output, flymake-proc-parse-line)
(flymake-output-residual): Delete.
(flymake-start-syntax-check-process): Use make-process.  Setup
dedicated an output buffer
lisp/progmodes/flymake-proc.el
lisp/progmodes/flymake.el