[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 2a2a1bd 4/5: Protect Flymake from being corrupted b
From: |
João Távora |
Subject: |
[Emacs-diffs] master 2a2a1bd 4/5: Protect Flymake from being corrupted by backends |
Date: |
Tue, 2 Jul 2019 12:11:06 -0400 (EDT) |
branch: master
commit 2a2a1bdb8f0f149aaf736a61685feec9380be1b1
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
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.
---
lisp/progmodes/flymake.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 83b5ee3..6f3d2d5 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