emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 309823ff779: Flymake: protect against problematic invalid diagnos


From: João Távora
Subject: master 309823ff779: Flymake: protect against problematic invalid diagnostics
Date: Thu, 26 Oct 2023 09:18:21 -0400 (EDT)

branch: master
commit 309823ff7796416414cee8c6f4d2650615c19f64
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Flymake: protect against problematic invalid diagnostics
    
    If a backend reports a diagnostic which is out of bounds, it still
    lives in flymake--state and will still be cleaned up in the next run
    of flymake--publish-diagnostics.  But if flymake--highlight-line
    doesn't give it an overlay (which it didn't until now), things will
    break afterwards.
    
    See bug#66759 and https://github.com/joaotavora/eglot/discussions/1311
    
    * lisp/progmodes/flymake.el (flymake--highlight-line): Set
    flymake--diag-overlay earlier.
    (Version): Bump to 1.3.7.
---
 lisp/progmodes/flymake.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index b27e6527f81..fb000517655 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -4,7 +4,7 @@
 
 ;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
 ;; Maintainer: João Távora <joaotavora@gmail.com>
-;; Version: 1.3.6
+;; Version: 1.3.7
 ;; Keywords: c languages tools
 ;; Package-Requires: ((emacs "26.1") (eldoc "1.14.0") (project "0.7.1"))
 
@@ -809,6 +809,7 @@ Return nil or the overlay created."
                         (flymake--diag-orig-end e))
                   (flymake--delete-overlay eov)))
     (setq ov (make-overlay beg end))
+    (setf (flymake--diag-overlay diagnostic) ov)
     (when (= (overlay-start ov) (overlay-end ov))
       ;; Some backends report diagnostics with invalid bounds.  Don't
       ;; bother.
@@ -863,7 +864,6 @@ Return nil or the overlay created."
     (overlay-put ov 'evaporate t)
     (overlay-put ov 'flymake-overlay t)
     (overlay-put ov 'flymake-diagnostic diagnostic)
-    (setf (flymake--diag-overlay diagnostic) ov)
     ;; Handle `flymake-show-diagnostics-at-end-of-line'
     ;;
     (when flymake-show-diagnostics-at-end-of-line



reply via email to

[Prev in Thread] Current Thread [Next in Thread]