emacs-diffs
[Top][All Lists]
Advanced

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

master b32c4d7: Clarify consequences of mismatching Flymake diagnostic b


From: João Távora
Subject: master b32c4d7: Clarify consequences of mismatching Flymake diagnostic buffers
Date: Sat, 2 Nov 2019 12:04:30 -0400 (EDT)

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

    Clarify consequences of mismatching Flymake diagnostic buffers
    
    Fix bug#34418.
    
    * doc/misc/flymake.texi (Flymake utility functions): Add note to
    flymake-make-diagnostic.
    
    * lisp/progmodes/flymake.el (flymake--handle-report): Discard
    diagnostics from other buffers.
---
 doc/misc/flymake.texi     | 4 +++-
 lisp/progmodes/flymake.el | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index ebb89c3..cedf1d8 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -543,7 +543,9 @@ by calling the function @code{flymake-make-diagnostic}.
 Make a Flymake diagnostic for @var{buffer}'s region from @var{beg} to
 @var{end}.  @var{type} is a diagnostic symbol (@pxref{Flymake error
 types}), and @var{text} is a description of the problem detected in
-this region.
+this region.  Currently, it is unspecified behaviour to make
+diagnostics for buffers other than the buffer that the Flymake backend
+is responsible for.
 @end deffn
 
 @cindex access diagnostic object
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 6891e19..474c633 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -749,7 +749,10 @@ report applies to that region."
                                   (format "Unknown action %S" report-action))
         (flymake-error "Expected report, but got unknown key %s" 
report-action))
        (t
-        (setq new-diags report-action)
+        (setq new-diags
+              (cl-remove-if-not
+               (lambda (diag) (eq (flymake--diag-buffer diag) 
(current-buffer)))
+               report-action))
         (save-restriction
           (widen)
           ;; Before adding to backend's diagnostic list, decide if



reply via email to

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