]> git.eshelyaron.com Git - emacs.git/commitdiff
Protect Flymake from being corrupted by backends
authorJoão Távora <joaotavora@gmail.com>
Fri, 29 Mar 2019 12:27:11 +0000 (12:27 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 2 Jul 2019 15:10:22 +0000 (16:10 +0100)
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.

lisp/progmodes/flymake.el

index 83b5ee33aa08f7898bd4a2b85c10e9e52da4da51..6f3d2d59b5c25b14972b1868e1124026c4553f7c 100644 (file)
@@ -604,10 +604,11 @@ associated `flymake-category' return DEFAULT."
 
 (defun flymake--highlight-line (diagnostic)
   "Highlight buffer with info in DIGNOSTIC."
-  (when-let* ((type (flymake--diag-type diagnostic))
-              (ov (make-overlay
-                   (flymake--diag-beg diagnostic)
-                   (flymake--diag-end diagnostic))))
+  (let ((type (or (flymake--diag-type diagnostic)
+                  :error))
+        (ov (make-overlay
+             (flymake--diag-beg diagnostic)
+             (flymake--diag-end diagnostic))))
     ;; First set `category' in the overlay
     ;;
     (overlay-put ov 'category