aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1996-10-20 05:37:38 +0000
committerKarl Heuer1996-10-20 05:37:38 +0000
commitc41fe4464006f52fdd69c779dee0a5bf1fa296e4 (patch)
treecf381bf73301fc2df1894df5986be1e0dbde4e7d
parent010d626940cdc7301c0785004851de98296a9cca (diff)
downloademacs-c41fe4464006f52fdd69c779dee0a5bf1fa296e4.tar.gz
emacs-c41fe4464006f52fdd69c779dee0a5bf1fa296e4.zip
(compilation-skip-to-next-location): Defined.
(compilation-next-error-locus, compilation-parse-errors): Respect it.
-rw-r--r--lisp/progmodes/compile.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 102e508d426..4fd5aac0956 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -992,6 +992,9 @@ This operates on the output from the \\[compile] command."
992 (interactive) 992 (interactive)
993 (next-error '(4))) 993 (next-error '(4)))
994 994
995(defvar compilation-skip-to-next-location nil
996 "*If non-nil, skip multiple error messages for the same source location.")
997
995(defun compilation-next-error-locus (&optional move reparse silent) 998(defun compilation-next-error-locus (&optional move reparse silent)
996 "Visit next compilation error and return locus in corresponding source code. 999 "Visit next compilation error and return locus in corresponding source code.
997This operates on the output from the \\[compile] command. 1000This operates on the output from the \\[compile] command.
@@ -1131,11 +1134,12 @@ The current buffer should be the desired compilation output buffer."
1131 (setq next-errors compilation-error-list 1134 (setq next-errors compilation-error-list
1132 next-error (car next-errors))))) 1135 next-error (car next-errors)))))
1133 1136
1134 ;; Skip over multiple error messages for the same source location, 1137 (if compilation-skip-to-next-location
1135 ;; so the next C-x ` won't go to an error in the same place. 1138 ;; Skip over multiple error messages for the same source location,
1136 (while (and compilation-error-list 1139 ;; so the next C-x ` won't go to an error in the same place.
1137 (equal (cdr (car compilation-error-list)) (cdr next-error))) 1140 (while (and compilation-error-list
1138 (setq compilation-error-list (cdr compilation-error-list))) 1141 (equal (cdr (car compilation-error-list)) (cdr next-error)))
1142 (setq compilation-error-list (cdr compilation-error-list))))
1139 1143
1140 ;; We now have a marker for the position of the error source code. 1144 ;; We now have a marker for the position of the error source code.
1141 ;; NEXT-ERROR is a cons (ERROR . SOURCE) of two markers. 1145 ;; NEXT-ERROR is a cons (ERROR . SOURCE) of two markers.
@@ -1456,7 +1460,9 @@ See variable `compilation-parse-errors-function' for the interface it uses."
1456 (let ((this (cons (point-marker) 1460 (let ((this (cons (point-marker)
1457 (list filename linenum column)))) 1461 (list filename linenum column))))
1458 ;; Don't add the same source line more than once. 1462 ;; Don't add the same source line more than once.
1459 (if (equal (cdr this) (cdr (car compilation-error-list))) 1463 (if (and compilation-skip-to-next-location
1464 (equal (cdr this)
1465 (cdr (car compilation-error-list))))
1460 nil 1466 nil
1461 (setq compilation-error-list 1467 (setq compilation-error-list
1462 (cons this 1468 (cons this