emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 bfc00f1c120: Eglot: fix setting of flymake-list-only-diagnostic


From: João Távora
Subject: emacs-29 bfc00f1c120: Eglot: fix setting of flymake-list-only-diagnostics (bug#59824)
Date: Wed, 7 Dec 2022 06:31:31 -0500 (EST)

branch: emacs-29
commit bfc00f1c12047ff431eaa9da3a744807c3f9e6e2
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: fix setting of flymake-list-only-diagnostics (bug#59824)
    
    When Eglot receives diagnostics for a file not yet visited in Emacs,
    it stores them in flymake-list-only-diagnostics, which feed M-x
    flymake-show-project-diagnostics.  If the file is eventually visited
    in a buffer and Eglot starts receibing diagnostics for it, the
    flymake-list-only-diagnostics database has to be updated accordingly,
    since the previous diagnostics are now stale.
    
    * lisp/progmodes/eglot.el (eglot-handle-notification): Reset
    flymake-list-only-diagnostics
---
 lisp/progmodes/eglot.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index c266f6e18a3..363ca004e47 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2060,9 +2060,11 @@ COMMAND is a symbol naming the command."
                     (t          'eglot-note)))
             (mess (source code message)
               (concat source (and code (format " [%s]" code)) ": " message)))
-    (if-let ((buffer (find-buffer-visiting (eglot--uri-to-path uri))))
+    (if-let* ((path (expand-file-name (eglot--uri-to-path uri)))
+              (buffer (find-buffer-visiting path)))
         (with-current-buffer buffer
           (cl-loop
+           initially (assoc-delete-all path flymake-list-only-diagnostics 
#'string=)
            for diag-spec across diagnostics
            collect (eglot--dbind ((Diagnostic) range code message severity 
source tags)
                        diag-spec
@@ -2105,7 +2107,6 @@ COMMAND is a symbol naming the command."
                          (t
                           (setq eglot--diagnostics diags)))))
       (cl-loop
-       with path = (expand-file-name (eglot--uri-to-path uri))
        for diag-spec across diagnostics
        collect (eglot--dbind ((Diagnostic) code range message severity source) 
diag-spec
                  (setq message (mess source code message))



reply via email to

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