summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/flymake-tests.el
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2017-09-06 16:03:24 +0100
committerJoão Távora <joaotavora@gmail.com>2017-10-03 13:49:04 +0100
commit1c30f9fc08649649676ed812f1579f0948558ceb (patch)
tree27150682706ea3cbf2f86def567e4c5083b8813d /test/lisp/progmodes/flymake-tests.el
parentbb8b663d327e79eb271b467317c283cc884106ac (diff)
downloademacs-1c30f9fc08649649676ed812f1579f0948558ceb.tar.gz
emacs-1c30f9fc08649649676ed812f1579f0948558ceb.tar.bz2
emacs-1c30f9fc08649649676ed812f1579f0948558ceb.zip
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'.
Diffstat (limited to 'test/lisp/progmodes/flymake-tests.el')
-rw-r--r--test/lisp/progmodes/flymake-tests.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el
index dda72a35d27..a018f11efd2 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -51,26 +51,26 @@
(ert-deftest warning-predicate-rx-gcc ()
"Test GCC warning via regexp predicate."
(skip-unless (and (executable-find "gcc") (executable-find "make")))
- (should (eq 'flymake-warnline
+ (should (eq 'flymake-warning
(flymake-tests--current-face "test.c" "^[Ww]arning"))))
(ert-deftest warning-predicate-function-gcc ()
"Test GCC warning via function predicate."
(skip-unless (and (executable-find "gcc") (executable-find "make")))
- (should (eq 'flymake-warnline
+ (should (eq 'flymake-warning
(flymake-tests--current-face "test.c"
(lambda (msg) (string-match "^[Ww]arning" msg))))))
(ert-deftest warning-predicate-rx-perl ()
"Test perl warning via regular expression predicate."
(skip-unless (executable-find "perl"))
- (should (eq 'flymake-warnline
+ (should (eq 'flymake-warning
(flymake-tests--current-face "test.pl" "^Scalar value"))))
(ert-deftest warning-predicate-function-perl ()
"Test perl warning via function predicate."
(skip-unless (executable-find "perl"))
- (should (eq 'flymake-warnline
+ (should (eq 'flymake-warning
(flymake-tests--current-face
"test.pl"
(lambda (msg) (string-match "^Scalar value" msg))))))