changeset 1273:bbf7e139412b

(compilation-parse-errors): After we get enough errors to stop early, toss the last one (which is for a different file), so we don't lose the same way on the next run.
author Roland McGrath <roland@gnu.org>
date Wed, 30 Sep 1992 01:45:47 +0000
parents bfd04f61eb16
children 4d867d1bedda
files lisp/progmodes/compile.el
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Wed Sep 30 01:11:20 1992 +0000
+++ b/lisp/progmodes/compile.el	Wed Sep 30 01:45:47 1992 +0000
@@ -918,7 +918,7 @@
 	       (setq alist (cdr alist)))
 	     (if alist
 		 (setq alist (car alist))
-	       (error "Impossible regexp match!"))
+	       (error "compilation-parse-errors: Impossible regexp match!"))
 	     
 	     ;; Extract the file name and line number from the error message.
 	     (let ((filename
@@ -952,7 +952,16 @@
 		  ;; in this buffer that might change.
 		  (not (equal (car (cdr (nth 0 compilation-error-list)))
 			      (car (cdr (nth 1 compilation-error-list)))))
-		  (setq found-desired t)))
+		  (progn
+		    ;; Discard the error just parsed, so that the next
+		    ;; parsing run can get it and the following errors in
+		    ;; the same file all at once.  If we didn't do this, we
+		    ;; would have the same problem we are trying to avoid
+		    ;; with the test above, just delayed until the next run!
+		    (setq compilation-error-list (cdr compilation-error-list))
+		    (goto-char (match-beginning 0))
+		    (setq found-desired t)))
+	     )
 	    (t
 	     (error "compilation-parse-errors: impossible regexp match!")))