]> git.eshelyaron.com Git - emacs.git/commitdiff
Flymake checks file names before considering diagnostics
authorJoão Távora <joaotavora@gmail.com>
Thu, 21 Sep 2017 13:45:21 +0000 (14:45 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 2 Oct 2017 23:53:11 +0000 (00:53 +0100)
The error patterns for gcc picked up errors for the Makefile itself,
for example.  These shouldn't count as actual errors.

* lisp/progmodes/flymake.el (flymake-report): Check
matching file names.

lisp/progmodes/flymake.el

index ada00ba4545a7b8d380599b604764d4f3a0a0855..6a96c061171eafe551e7fc8956c02e00bb569242 100644 (file)
@@ -452,6 +452,14 @@ return DEFAULT."
   (save-restriction
     (widen)
     (flymake-delete-own-overlays)
+    (setq diagnostics
+          (cl-remove-if-not
+           (lambda (diag)
+             (let ((ff (flymake--diag-full-file diag)))
+               (and ff
+                    (equal (expand-file-name ff)
+                           (expand-file-name (buffer-file-name))))))
+           diagnostics))
     (mapc #'flymake--fix-line-numbers diagnostics)
     (mapc #'flymake--highlight-line diagnostics)
     (let ((err-count (cl-count-if #'flymake--diag-errorp diagnostics))