diff options
| author | Roland McGrath | 1995-05-12 17:26:59 +0000 |
|---|---|---|
| committer | Roland McGrath | 1995-05-12 17:26:59 +0000 |
| commit | eae2c972e7c10088ced31c2d89b68eddd35773c3 (patch) | |
| tree | f9bda7b4127f8f0520cc1015b18a41a2c4414e7b | |
| parent | 38179d42888c5f2827f8f8d51729028d425c02b9 (diff) | |
| download | emacs-eae2c972e7c10088ced31c2d89b68eddd35773c3.tar.gz emacs-eae2c972e7c10088ced31c2d89b68eddd35773c3.zip | |
(compilation-next-error-locus): Ignore zero column number.
(compilation-parse-errors): Don't store the beginning of the line
containing the end of the error-regexp match. Instead, store the beginning
of the line containing the start of the match, unless the match starts
with a newline, in which case the beginning of the next line.
| -rw-r--r-- | lisp/progmodes/compile.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index aa7334e4d5d..6c2caef14a6 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -902,14 +902,14 @@ See variables `compilation-parse-errors-function' and | |||
| 902 | "Visit previous compilation error message and corresponding source code. | 902 | "Visit previous compilation error message and corresponding source code. |
| 903 | This operates on the output from the \\[compile] command." | 903 | This operates on the output from the \\[compile] command." |
| 904 | (interactive) | 904 | (interactive) |
| 905 | (next-error '-1)) | 905 | (next-error -1)) |
| 906 | 906 | ||
| 907 | (defun first-error () | 907 | (defun first-error () |
| 908 | "Reparse the error message buffer and start at the first error | 908 | "Reparse the error message buffer and start at the first error |
| 909 | Visit corresponding source code. | 909 | Visit corresponding source code. |
| 910 | This operates on the output from the \\[compile] command." | 910 | This operates on the output from the \\[compile] command." |
| 911 | (interactive) | 911 | (interactive) |
| 912 | (next-error '(1.1))) | 912 | (next-error '(4))) |
| 913 | 913 | ||
| 914 | (defun compilation-next-error-locus (&optional move reparse silent) | 914 | (defun compilation-next-error-locus (&optional move reparse silent) |
| 915 | "Visit next compilation error and return locus in corresponding source code. | 915 | "Visit next compilation error and return locus in corresponding source code. |
| @@ -1037,8 +1037,9 @@ The current buffer should be the desired compilation output buffer." | |||
| 1037 | nil 'end | 1037 | nil 'end |
| 1038 | lines)) | 1038 | lines)) |
| 1039 | (forward-line lines)) | 1039 | (forward-line lines)) |
| 1040 | (if column | 1040 | (if (and column (> column 1)) |
| 1041 | (move-to-column (1- column))) | 1041 | (move-to-column (1- column)) |
| 1042 | (beginning-of-line)) | ||
| 1042 | (setq last-line this) | 1043 | (setq last-line this) |
| 1043 | (setcdr (car errors) (point-marker)))) | 1044 | (setcdr (car errors) (point-marker)))) |
| 1044 | (setq errors (cdr errors))))))))) | 1045 | (setq errors (cdr errors))))))))) |
| @@ -1077,7 +1078,9 @@ Selects a window with point at SOURCE, with another window displaying ERROR." | |||
| 1077 | 1078 | ||
| 1078 | ;; Show compilation buffer in other window, scrolled to this error. | 1079 | ;; Show compilation buffer in other window, scrolled to this error. |
| 1079 | (let* ((pop-up-windows t) | 1080 | (let* ((pop-up-windows t) |
| 1081 | ;; Use an existing window if it is in a visible frame. | ||
| 1080 | (w (or (get-buffer-window (marker-buffer (car next-error)) 'visible) | 1082 | (w (or (get-buffer-window (marker-buffer (car next-error)) 'visible) |
| 1083 | ;; Pop up a window. | ||
| 1081 | (display-buffer (marker-buffer (car next-error)))))) | 1084 | (display-buffer (marker-buffer (car next-error)))))) |
| 1082 | (set-window-point w (car next-error)) | 1085 | (set-window-point w (car next-error)) |
| 1083 | (set-window-start w (car next-error)) | 1086 | (set-window-start w (car next-error)) |
| @@ -1344,7 +1347,11 @@ See variable `compilation-parse-errors-function' for the interface it uses." | |||
| 1344 | ;; giving a marker for the current compilation buffer | 1347 | ;; giving a marker for the current compilation buffer |
| 1345 | ;; location, and the file and line number of the error. | 1348 | ;; location, and the file and line number of the error. |
| 1346 | (save-excursion | 1349 | (save-excursion |
| 1347 | (beginning-of-line 1) | 1350 | ;; Save as the start of the error the beginning of the |
| 1351 | ;; line containing the match unless the match starts at a | ||
| 1352 | ;; newline, in which case the beginning of the next line. | ||
| 1353 | (goto-char beginning-of-match) | ||
| 1354 | (forward-line (if (eolp) 1 0)) | ||
| 1348 | (let ((this (cons (point-marker) | 1355 | (let ((this (cons (point-marker) |
| 1349 | (list filename linenum column)))) | 1356 | (list filename linenum column)))) |
| 1350 | ;; Don't add the same source line more than once. | 1357 | ;; Don't add the same source line more than once. |