]> git.eshelyaron.com Git - emacs.git/commit
Flymake diagnostics now apply to arbitrary buffer regions
authorJoão Távora <joaotavora@gmail.com>
Wed, 6 Sep 2017 15:03:24 +0000 (16:03 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 2 Oct 2017 23:53:11 +0000 (00:53 +0100)
commit6a5e6ad53444b3c0def5c7de016cfff3017e5b39
tree9f8f6810df0d648fbf077a60eef26ea04a8f93dc
parent1f40144029c0f8daf906555d3d92a138617a0d59
Flymake diagnostics now apply to arbitrary buffer regions

Make Flymake UI some 150 lines lighter

Strip away much of the original implementation's complexity in
manipulating objects representing diagnostics as well as creating and
navigating overlays.

Lay some groundwork for a more flexible approach that allows for
different classes of diagnostics, not necessarily line-based.
Importantly, one overlay per diagnostic is created, whereas the
original implementation had one per line, and on it it concatenated
the results of errors and warnings.

This means that currently, an error and warning on the same line are
problematic and the warning might be overlooked but this will soon be
fixed by setting appropriate priorities.

Since diagnostics can highlight arbitrary regions, not just lines, the
faces were renamed.

Tests pass and backward compatibility with interactive functions is
maintained, but probably any third-party extension or customization
relying on more than a trivial set of flymake.el internals has stopped
working.

* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make
constructor syntax.

* lisp/progmodes/flymake.el (flymake-ins-after)
(flymake-set-at, flymake-er-make-er, flymake-er-get-line)
(flymake-er-get-line-err-info-list, flymake-ler-set-file)
(flymake-ler-set-full-file, flymake-ler-set-line)
(flymake-get-line-err-count, flymake-get-err-count)
(flymake-highlight-err-lines, flymake-overlay-p)
(flymake-make-overlay, flymake-region-has-flymake-overlays)
(flymake-find-err-info)
(flymake-line-err-info-is-less-or-equal)
(flymake-add-line-err-info, flymake-add-err-info)
(flymake-get-first-err-line-no)
(flymake-get-last-err-line-no, flymake-get-next-err-line-no)
(flymake-get-prev-err-line-no, flymake-skip-whitespace)
(flymake-goto-line, flymake-goto-next-error)
(flymake-goto-prev-error, flymake-patch-err-text): Delete
functions no longer used.
(flymake-goto-next-error, flymake-goto-prev-error): Rewrite.
(flymake-report): Rewrite.
(flymake-popup-current-error-menu): Rewrite.
(flymake--highlight-line): Rename from
flymake-highlight-line.  Call `flymake--place-overlay.
(flymake--place-overlay): New function.
(flymake-ler-errorp): New predicate.
(flymake-ler): Simplify.
(flymake-error): Rename from
flymake-errline.
(flymake-warning): Rename from flymake-warnline.
(flymake-warnline, flymake-errline): Obsoletion aliases.

* test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc)
(warning-predicate-function-gcc, warning-predicate-rx-perl)
(warning-predicate-function-perl): Use face `flymake-warning'.
lisp/progmodes/flymake-proc.el
lisp/progmodes/flymake.el
test/lisp/progmodes/flymake-tests.el