aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2019-03-29 12:27:11 +0000
committerJoão Távora2019-07-02 16:10:22 +0100
commit2a2a1bdb8f0f149aaf736a61685feec9380be1b1 (patch)
treeada718fcce19130d1c5bc037fc8541000a02bbd2
parent1bf5be5d37f5bd72aecd2ee266d069d9a9cafc10 (diff)
downloademacs-2a2a1bdb8f0f149aaf736a61685feec9380be1b1.tar.gz
emacs-2a2a1bdb8f0f149aaf736a61685feec9380be1b1.zip
Protect Flymake from being corrupted by backends
A backend building a diagnostic with a nil :type would cause Flymake to create a diagnostic without an overlay, confusing Flymake's accounting of overlays and diagnostics * lisp/progmodes/flymake.el (flymake--highlight-line): Return non-nil unconditionally.
-rw-r--r--lisp/progmodes/flymake.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 83b5ee33aa0..6f3d2d59b5c 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -604,10 +604,11 @@ associated `flymake-category' return DEFAULT."
604 604
605(defun flymake--highlight-line (diagnostic) 605(defun flymake--highlight-line (diagnostic)
606 "Highlight buffer with info in DIGNOSTIC." 606 "Highlight buffer with info in DIGNOSTIC."
607 (when-let* ((type (flymake--diag-type diagnostic)) 607 (let ((type (or (flymake--diag-type diagnostic)
608 (ov (make-overlay 608 :error))
609 (flymake--diag-beg diagnostic) 609 (ov (make-overlay
610 (flymake--diag-end diagnostic)))) 610 (flymake--diag-beg diagnostic)
611 (flymake--diag-end diagnostic))))
611 ;; First set `category' in the overlay 612 ;; First set `category' in the overlay
612 ;; 613 ;;
613 (overlay-put ov 'category 614 (overlay-put ov 'category