From: João Távora Date: Thu, 21 Sep 2017 13:45:21 +0000 (+0100) Subject: Flymake checks file names before considering diagnostics X-Git-Tag: emacs-26.0.90~56^2^2~25 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=491cc4a1bd68c2f651027982e3dfb7545d3e57ab;p=emacs.git Flymake checks file names before considering diagnostics 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. --- diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index f9aa098071b..827bce4b634 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -451,6 +451,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))