From: João Távora Date: Fri, 29 Mar 2019 12:27:11 +0000 (+0000) Subject: Protect Flymake from being corrupted by backends X-Git-Tag: emacs-27.0.90~2125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a2a1bdb8f0f149aaf736a61685feec9380be1b1;p=emacs.git 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. --- 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." (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