aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1992-10-01 02:00:41 +0000
committerRoland McGrath1992-10-01 02:00:41 +0000
commit1f82d0e4d0d55db82cb70eb4f234c5bd1a018adb (patch)
tree413f515909d6788ecec91bcb53ea51ddf3878dbf
parent07bd847225441d580fd4ac11731ac9e679dbddbe (diff)
downloademacs-1f82d0e4d0d55db82cb70eb4f234c5bd1a018adb.tar.gz
emacs-1f82d0e4d0d55db82cb70eb4f234c5bd1a018adb.zip
(compilation-parse-errors): Save (match-beginning 0) in a variable, so the
looking-at call doesn't clobber its value when we want to use it to back up before the error we discard. Make sure compilation-error-list is at least two elts long before checking its first two elts for being in the same file.
-rw-r--r--lisp/progmodes/compile.el47
1 files changed, 26 insertions, 21 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 42585599699..a01ec3dcace 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -921,7 +921,8 @@ See variable `compilation-parse-errors-function' for the interface it uses."
921 (error "compilation-parse-errors: Impossible regexp match!")) 921 (error "compilation-parse-errors: Impossible regexp match!"))
922 922
923 ;; Extract the file name and line number from the error message. 923 ;; Extract the file name and line number from the error message.
924 (let ((filename 924 (let ((beginning-of-match (match-beginning 0)) ;looking-at nukes
925 (filename
925 (cons default-directory 926 (cons default-directory
926 (buffer-substring (match-beginning (nth 1 alist)) 927 (buffer-substring (match-beginning (nth 1 alist))
927 (match-end (nth 1 alist))))) 928 (match-end (nth 1 alist)))))
@@ -941,26 +942,30 @@ See variable `compilation-parse-errors-function' for the interface it uses."
941 (setq compilation-error-list 942 (setq compilation-error-list
942 (cons (cons (point-marker) 943 (cons (cons (point-marker)
943 (cons filename linenum)) 944 (cons filename linenum))
944 compilation-error-list)))) 945 compilation-error-list)))
945 (setq compilation-num-errors-found 946 (setq compilation-num-errors-found
946 (1+ compilation-num-errors-found)) 947 (1+ compilation-num-errors-found))
947 (and find-at-least (>= compilation-num-errors-found find-at-least) 948 (and find-at-least (>= compilation-num-errors-found
948 ;; We have found as many new errors as the user wants. 949 find-at-least)
949 ;; We continue to parse until we have seen all 950 ;; We have found as many new errors as the user wants.
950 ;; the consecutive errors in the same file, 951 ;; We continue to parse until we have seen all
951 ;; so the error positions will be recorded as markers 952 ;; the consecutive errors in the same file,
952 ;; in this buffer that might change. 953 ;; so the error positions will be recorded as markers
953 (not (equal (car (cdr (nth 0 compilation-error-list))) 954 ;; in this buffer that might change.
954 (car (cdr (nth 1 compilation-error-list))))) 955 (cdr compilation-error-list) ; Must check at least two.
955 (progn 956 (not (equal (car (cdr (nth 0 compilation-error-list)))
956 ;; Discard the error just parsed, so that the next 957 (car (cdr (nth 1 compilation-error-list)))))
957 ;; parsing run can get it and the following errors in 958 (progn
958 ;; the same file all at once. If we didn't do this, we 959 ;; Discard the error just parsed, so that the next
959 ;; would have the same problem we are trying to avoid 960 ;; parsing run can get it and the following errors in
960 ;; with the test above, just delayed until the next run! 961 ;; the same file all at once. If we didn't do this, we
961 (setq compilation-error-list (cdr compilation-error-list)) 962 ;; would have the same problem we are trying to avoid
962 (goto-char (match-beginning 0)) 963 ;; with the test above, just delayed until the next run!
963 (setq found-desired t))) 964 (setq compilation-error-list
965 (cdr compilation-error-list))
966 (goto-char beginning-of-match)
967 (setq found-desired t)))
968 )
964 ) 969 )
965 (t 970 (t
966 (error "compilation-parse-errors: impossible regexp match!"))) 971 (error "compilation-parse-errors: impossible regexp match!")))