changeset 18565:1df558397136

(compilation-parse-errors): Skip 2 lines only for Compilation major mode.
author Richard M. Stallman <rms@gnu.org>
date Wed, 02 Jul 1997 19:29:45 +0000
parents ff178e0a7423
children 496848617eb4
files lisp/progmodes/compile.el
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Wed Jul 02 18:17:11 1997 +0000
+++ b/lisp/progmodes/compile.el	Wed Jul 02 19:29:45 1997 +0000
@@ -160,7 +160,10 @@
     ;; Microsoft C/C++:
     ;;  keyboard.c(537) : warning C4005: 'min' : macro redefinition
     ;;  d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if'
-    ("\\(\\([a-zA-Z]:\\)?[^:( \t\n-]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" 1 3)
+    ;; This used to be less selective and allow characters other than
+    ;; parens around the line number, but that caused confusion for
+    ;; GNU-style error messages.
+    ("\\(\\([a-zA-Z]:\\)?[^:( \t\n-]+\\)(\\([0-9]+\\))" 1 3)
 
     ;; Borland C++:
     ;;  Error ping.c 15: Unable to open include file 'sys/types.h'
@@ -241,9 +244,10 @@
     ;; E, file.cc(35,52) Illegal operation on pointers
     ("[EW], \\([^(\n]*\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)" 1 2 3)
 
-    ;; GNU messages with program name and optional column number.
-    ("[a-zA-Z]?:?[^0-9 \n\t:]+[^ \n\t:]*:[ \t]*\\([^ \n\t:]+\\):\
-\\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4)
+;;; This seems to be superfluous because the first pattern matches it.
+;;;    ;; GNU messages with program name and optional column number.
+;;;    ("[a-zA-Z]?:?[^0-9 \n\t:]+[^ \n\t:]*:[ \t]*\\([^ \n\t:]+\\):\
+;;;\\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4)
 
     ;; Cray C compiler error messages
     ("\\(cc\\| cft\\)-[0-9]+ c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \
@@ -1581,12 +1585,12 @@
 
     ;; Don't reparse messages already seen at last parse.
     (goto-char compilation-parsing-end)
-    (if (bobp)
-	(progn
-	  (setq compilation-current-file nil) ; No current file at start.
-	  ;; Don't parse the first two lines as error messages.
-	  ;; This matters for grep.
-	  (forward-line 2)))
+    (when (and (bobp)
+	       (eq major-mode 'compilation-mode))
+      (setq compilation-current-file nil) ; No current file at start.
+      ;; Don't parse the first two lines as error messages.
+      ;; This matters for grep.
+      (forward-line 2))
 
     ;; Parse messages.
     (while (not (or found-desired (eobp)))