emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master b78363e: Cleanup stale diagnostics on Flymake resta


From: João Távora
Subject: [Emacs-diffs] master b78363e: Cleanup stale diagnostics on Flymake restart
Date: Sun, 10 Feb 2019 07:06:42 -0500 (EST)

branch: master
commit b78363eb0f51126b2c22d26ea1b91f6e4569e167
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Cleanup stale diagnostics on Flymake restart
    
    Not doing so would cause duplicate diagnostics.  See
    https://github.com/joaotavora/eglot/issues/223 for an example.
    
    * lisp/progmodes/flymake.el (Version): 1.0.4
    (flymake-mode): Cleanup overlays before starting Flymake.
---
 lisp/progmodes/flymake.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index d7cb226..15a4d25 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -4,7 +4,7 @@
 
 ;; Author:  Pavel Kobyakov <address@hidden>
 ;; Maintainer: João Távora <address@hidden>
-;; Version: 1.0.3
+;; Version: 1.0.4
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: c languages tools
 
@@ -974,6 +974,11 @@ special *Flymake log* buffer."  :group 'flymake :lighter
     (add-hook 'after-save-hook 'flymake-after-save-hook nil t)
     (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
 
+    ;; If Flymake happened to be alrady already ON, we must cleanup
+    ;; existing diagnostic overlays, lest we forget them by blindly
+    ;; reinitializing `flymake--backend-state' in the next line.
+    ;; See https://github.com/joaotavora/eglot/issues/223.
+    (mapc #'delete-overlay (flymake--overlays))
     (setq flymake--backend-state (make-hash-table))
     (setq flymake--recent-changes nil)
 



reply via email to

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