From 41acdfa97af4c90bc06395f9a7dcaae419b711fc Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 30 Sep 1992 01:45:47 +0000 Subject: [PATCH] (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. --- lisp/progmodes/compile.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 39b62179b7d..42585599699 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -918,7 +918,7 @@ See variable `compilation-parse-errors-function' for the interface it uses." (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 @@ See variable `compilation-parse-errors-function' for the interface it uses." ;; 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!")))