changeset 18984:d2c26a873eb4

(compilation-error-regexp-alist): Add elt for EPC F90. compilation-mode-font-lock-keywords: Ensure that each regexp generated from compilation-error-regexp-alist begins with "^".
author Richard M. Stallman <rms@gnu.org>
date Fri, 25 Jul 1997 17:29:29 +0000
parents f61d1bd17b11
children 3fa26ad85f77
files lisp/progmodes/compile.el
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Fri Jul 25 13:34:18 1997 +0000
+++ b/lisp/progmodes/compile.el	Fri Jul 25 17:29:29 1997 +0000
@@ -276,6 +276,10 @@
     ;; Semantic error at line 528, column 5, file erosacqdb.pc:
     ("Semantic error at line \\([0-9]+\\), column \\([0-9]+\\), file \\(.*\\):"
      3 1 2)
+
+    ;; EPC F90 compiler:
+    ;; Error 24 at (2:progran.f90) : syntax error
+    ("Error [0-9]+ at (\\([0-9]*\\):\\([^)\n]+\\))" 2 1)
     )
   "Alist that specifies how to match errors in compiler output.
 Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...])
@@ -448,10 +452,19 @@
   (nconc
    ;;
    ;; Compiler warning/error lines.
-   (mapcar #'(lambda (item)
-	       (list (nth 0 item)
-		     (list (nth 1 item) 'font-lock-warning-face nil t)
-		     (list (nth 2 item) 'font-lock-variable-name-face nil t)))
+   (mapcar (function
+	    (lambda (item)
+	      ;; Prepend "^", adjusting FILE-IDX and LINE-IDX accordingly.
+	      (let ((file-idx (nth 1 item)) (line-idx (nth 2 item)) keyword)
+		(when (numberp line-idx)
+		  (setq keyword
+			(cons (list (1+ line-idx) 'font-lock-variable-name-face)
+			      keyword)))
+		(when (numberp file-idx)
+		  (setq keyword
+			(cons (list (1+ file-idx) 'font-lock-warning-face)
+			      keyword)))
+		(cons (concat "^\\(" (nth 0 item) "\\)") keyword))))
 	   compilation-error-regexp-alist)
    (list
     ;;