From: Richard M. Stallman Date: Sat, 14 Aug 1993 03:45:08 +0000 (+0000) Subject: (compilation-parse-errors): Don't add multiple errors for one source line. X-Git-Tag: emacs-19.34~11239 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ba2700dbbee127141f9c42ae70287d58ab071269;p=emacs.git (compilation-parse-errors): Don't add multiple errors for one source line. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 592eb7b0c13..752d278033c 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1077,12 +1077,16 @@ See variable `compilation-parse-errors-function' for the interface it uses." ;; location, and the file and line number of the error. (save-excursion (beginning-of-line 1) - (setq compilation-error-list - (cons (cons (point-marker) - (cons filename linenum)) - compilation-error-list))) - (setq compilation-num-errors-found - (1+ compilation-num-errors-found)) + (let ((this (cons (point-marker) + (cons filename linenum)))) + ;; Don't add the same source line more than once. + (if (equal (cdr this) (cdr (car compilation-error-list))) + nil + (setq compilation-error-list + (cons this + compilation-error-list)) + (setq compilation-num-errors-found + (1+ compilation-num-errors-found))))) (and find-at-least (>= compilation-num-errors-found find-at-least) ;; We have found as many new errors as the user wants.