diff lisp/packages/compile.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 0293115a14e9
children 54cc21c15cbb
line wrap: on
line diff
--- a/lisp/packages/compile.el	Mon Aug 13 09:00:04 2007 +0200
+++ b/lisp/packages/compile.el	Mon Aug 13 09:02:59 2007 +0200
@@ -125,24 +125,24 @@
     ;; We'll insist that the number be followed by a colon or closing
     ;; paren, because otherwise this matches just about anything
     ;; containing a number with spaces around it.
-    ("\
+    ("\n\
 \\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
 :\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5)
 
     ;; 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)
+    ("\n\\(\\([a-zA-Z]:\\)?[^:( \t\n-]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" 1 3)
 
     ;; Borland C++:
     ;;  Error ping.c 15: Unable to open include file 'sys/types.h'
     ;;  Warning ping.c 68: Call to function 'func' with no prototype
-    ("\\(Error\\|Warning\\) \\([a-zA-Z]?:?[^:( \t\n]+\\)\
+    ("\n\\(Error\\|Warning\\) \\([a-zA-Z]?:?[^:( \t\n]+\\)\
  \\([0-9]+\\)\\([) \t]\\|:[^0-9\n]\\)" 2 3)
 
     ;; 4.3BSD lint pass 2
     ;; 	strcmp: variable # of args. llib-lc(359)  ::  /usr/src/foo/foo.c(8)
-    ("[^\n]*[ \t:]\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(](+[ \t]*\\([0-9]+\\))[:) \t]*$"
+    ("[ \t:]\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(](+[ \t]*\\([0-9]+\\))[:) \t]*$"
      1 2)
 
     ;; 4.3BSD lint pass 3
@@ -150,26 +150,26 @@
     ;; This used to be
     ;; ("[ \t(]+\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]+" 1 2)
     ;; which is regexp Impressionism - it matches almost anything!
-    ("[^\n]*([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\))" 1 2)
+    ("([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\))" 1 2)
 
     ;; MIPS lint pass<n>; looks good for SunPro lint also
     ;;  TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomon.c due to truncation
-    ("[^ \n]+ (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
+    ("[^ ]+ (\\([0-9]+\\)) in \\([^ ]+\\)" 2 1)
     ;;  name defined but never used: LinInt in cmap_calc.c(199)
-    ("[^\n]*in \\([^(\n]+\\)(\\([0-9]+\\))$" 1 2)
+    ("in \\([^(]+\\)(\\([0-9]+\\))$" 1 2)
 
     ;; Ultrix 3.0 f77:
     ;;  fort: Severe: addstf.f, line 82: Missing operator or delimiter symbol
     ;; Some SGI cc version:
     ;;  cfe: Warning 835: foo.c, line 2: something
-    ("\\(cfe\\|fort\\): [^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3)
+    ("\n\\(cfe\\|fort\\): [^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3)
     ;;  Error on line 3 of t.f: Execution error unclassifiable statement    
     ;; Unknown who does this:
     ;;  Line 45 of "foo.c": bloofle undefined
     ;; Absoft FORTRAN 77 Compiler 3.1.3
     ;;  error on line 19 of fplot.f: spelling error?
     ;;  warning on line 17 of fplot.f: data type is undefined for variable d
-    ("\\(\\|[^\n]* on \\)[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\
+    ("\\(\n\\|on \\)[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\
 of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2)
 
     ;; Apollo cc, 4.3BSD fc:
@@ -184,66 +184,58 @@
     ;;  "foo.adb", line 2(11): warning: file name does not match ...
     ;; IBM AIX xlc compiler:
     ;;  "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment.
-    ("[^\n]*\"\\([^,\" \n\t]+\\)\", lines? \
+    ("\"\\([^,\" \n\t]+\\)\", lines? \
 \\([0-9]+\\)\\([\(.]\\([0-9]+\\)\)?\\)?[:., (-]" 1 2 4)
 
     ;; MIPS RISC CC - the one distributed with Ultrix:
     ;;	ccom: Error: foo.c, line 2: syntax error
     ;; DEC AXP OSF/1 cc
     ;;  /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah 
-    ("[^\n]*rror: \\([^,\" \n\t]+\\)[,:] \\(line \\)?\\([0-9]+\\):" 1 3)
+    ("rror: \\([^,\" \n\t]+\\)[,:] \\(line \\)?\\([0-9]+\\):" 1 3)
 
     ;; IBM AIX PS/2 C version 1.1:
     ;;	****** Error number 140 in line 8 of file errors.c ******
-    ("[^\n]*in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
+    ("in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
     ;; IBM AIX lint is too painful to do right this way.  File name
     ;; prefixes entire sections rather than being on each line.
 
     ;; Lucid Compiler, lcc 3.x
     ;; E, file.cc(35,52) Illegal operation on pointers
-    ("[EW], \\([^(\n]*\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)" 1 2 3)
+    ("\n[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:]+:[ \t]*\\([^ \n\t:]+\\):\
+    ("\n[a-zA-Z]?:?[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\
 \\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4)
 
-    ;; GNU messages with program name and optional column number
-    ;; and a severity letter after that.  nsgmls makes them.
-    ("[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\
-\\([0-9]+\\):\\(\\([0-9]+\\):\\)?[A-Za-z]:" 1 2 4)
-
     ;; jwz:
     ;; IRIX 5.2
     ;; cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ...
-    ("[^\n]* \\([^ \n,\"]+\\), line \\([0-9]+\\):" 1 2)
+    (" \\([^ \"\n,]+\\), line \\([0-9]+\\):" 1 2)
     ;; IRIX 5.2
     ;; cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ...
-    ("[^\n]*: \\([^ \n,\"]+\\): \\([0-9]+\\):" 1 2)
+    (": \\([^ \n,]+\\): \\([0-9]+\\):" 1 2)
 
     ;; Cray C compiler error messages
-    ("\\(cc\\| cft\\)-[0-9]+ c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \\([^,\n]+\\), Line = \\([0-9]+\\)" 4 5)
+    ("\n\\(cc\\| cft\\)-[0-9]+ c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \\([^,\n]+\\), Line = \\([0-9]+\\)" 4 5)
 
     ;; IBM C/C++ Tools 2.01:
     ;;  foo.c(2:0) : informational EDC0804: Function foo is not referenced.
     ;;  foo.c(3:8) : warning EDC0833: Implicit return statement encountered.
     ;;  foo.c(5:5) : error EDC0350: Syntax error.
-    ("\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) : " 1 2 3)
+    ("\n\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) : " 1 2 3)
 
     ;; Sun ada (VADS, Solaris):
     ;;  /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: "," inserted
-    ("\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
+    ("\n\\([^, ]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
     )
- "Alist that specifies how to match errors in compiler output.
+  "Alist that specifies how to match errors in compiler output.
 Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...])
-If REGEXP matches constrained to the beginning of the line, the
-FILE-IDX'th subexpression gives the file name, and the LINE-IDX'th
-subexpression gives the line number.  If COLUMN-IDX is given, the
-COLUMN-IDX'th subexpression gives the column number on that line.  If
-any FILE-FORMAT is given, each is a format string to produce a file name
-to try; %s in the string is replaced by the text matching the
-FILE-IDX'th subexpression.  Note previously REGEXP was not constrained
-to the beginning of the line, so old patterns without leading `^' or `\\n'
-may now require a leading `.*'.")
+If REGEXP matches, the FILE-IDX'th subexpression gives the file name, and
+the LINE-IDX'th subexpression gives the line number.  If COLUMN-IDX is
+given, the COLUMN-IDX'th subexpression gives the column number on that line.
+If any FILE-FORMAT is given, each is a format string to produce a file name to
+try; %s in the string is replaced by the text matching the FILE-IDX'th
+subexpression.")
 
 (defvar compilation-read-command t
   "If not nil, M-x compile reads the compilation command to use.
@@ -280,14 +272,14 @@
 					    buffer-file-name))))))")
 
 (defvar compilation-enter-directory-regexp
-  "[^\n]*: Entering directory `\\([^\n]*\\)'$"
+  ": Entering directory `\\(.*\\)'$"
   "Regular expression matching lines that indicate a new current directory.
 This must contain one \\(, \\) pair around the directory name.
 
 The default value matches lines printed by the `-w' option of GNU Make.")
 
 (defvar compilation-leave-directory-regexp
-  "[^\n]*: Leaving directory `\\([^\n]*\\)'$"
+  ": Leaving directory `\\(.*\\)'$"
   "Regular expression matching lines that indicate restoring current directory.
 This may contain one \\(, \\) pair around the name of the directory
 being moved from.  If it does not, the last directory entered \(by a
@@ -311,7 +303,7 @@
 (defvar grep-history nil)
 
 ;; XEmacs
-(defvar compilation-font-lock-keywords (purecopy
+(defconst compilation-font-lock-keywords (purecopy
   (list
    '("^[-_.\"A-Za-z0-9/+]+\\(:\\|, line \\)[0-9]+: \\([wW]arning:\\).*$" .
      font-lock-keyword-face)
@@ -1577,16 +1569,7 @@
 		;; We don't just pass LIMIT-SEARCH to re-search-forward
 		;; because we want to find matches containing LIMIT-SEARCH
 		;; but which extend past it.
-		;; Instead of using re-search-forward,
-		;; we use this loop which tries only at each line.
-		(progn
-		  (while (and (not (eobp))
-			      (not (looking-at regexp)))
-		    (forward-line 1))
-		  (not (eobp))))
-
-      ;; Move to the end of the match we just found.
-      (goto-char (match-end 0))
+		(re-search-forward regexp nil t))
 
       ;; Figure out which constituent regexp matched.
       (cond ((match-beginning enter-group)