changeset 11804:7a7da7fca594

(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.
author Roland McGrath <roland@gnu.org>
date Fri, 12 May 1995 17:26:59 +0000
parents 0e58ab232517
children 95a2506fba60
files lisp/progmodes/compile.el
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Fri May 12 16:39:32 1995 +0000
+++ b/lisp/progmodes/compile.el	Fri May 12 17:26:59 1995 +0000
@@ -902,14 +902,14 @@
   "Visit previous compilation error message and corresponding source code.
 This operates on the output from the \\[compile] command."
   (interactive)
-  (next-error '-1))
+  (next-error -1))
 
 (defun first-error ()
   "Reparse the error message buffer and start at the first error
 Visit corresponding source code.
 This operates on the output from the \\[compile] command."
   (interactive)
-  (next-error '(1.1)))
+  (next-error '(4)))
 
 (defun compilation-next-error-locus (&optional move reparse silent)
   "Visit next compilation error and return locus in corresponding source code.
@@ -1037,8 +1037,9 @@
 								nil 'end
 								lines))
 					 (forward-line lines))
-				       (if column
-					   (move-to-column (1- column)))
+				       (if (and column (> column 1))
+					   (move-to-column (1- column))
+					 (beginning-of-line))
 				       (setq last-line this)
 				       (setcdr (car errors) (point-marker))))
 				(setq errors (cdr errors)))))))))
@@ -1077,7 +1078,9 @@
 
   ;; Show compilation buffer in other window, scrolled to this error.
   (let* ((pop-up-windows t)
+	 ;; Use an existing window if it is in a visible frame.
 	 (w (or (get-buffer-window (marker-buffer (car next-error)) 'visible)
+		;; Pop up a window.
 		(display-buffer (marker-buffer (car next-error))))))
     (set-window-point w (car next-error))
     (set-window-start w (car next-error))
@@ -1344,7 +1347,11 @@
 	       ;; giving a marker for the current compilation buffer
 	       ;; location, and the file and line number of the error.
 	       (save-excursion
-		 (beginning-of-line 1)
+		 ;; Save as the start of the error the beginning of the
+		 ;; line containing the match unless the match starts at a
+		 ;; newline, in which case the beginning of the next line.
+		 (goto-char beginning-of-match)
+		 (forward-line (if (eolp) 1 0))
 		 (let ((this (cons (point-marker)
 				   (list filename linenum column))))
 		   ;; Don't add the same source line more than once.