comparison lisp/progmodes/compile.el @ 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 5d7968727c67
children 528cead9a6c3
comparison
equal deleted inserted replaced
18983:f61d1bd17b11 18984:d2c26a873eb4
274 274
275 ;; Oracle pro*c: 275 ;; Oracle pro*c:
276 ;; Semantic error at line 528, column 5, file erosacqdb.pc: 276 ;; Semantic error at line 528, column 5, file erosacqdb.pc:
277 ("Semantic error at line \\([0-9]+\\), column \\([0-9]+\\), file \\(.*\\):" 277 ("Semantic error at line \\([0-9]+\\), column \\([0-9]+\\), file \\(.*\\):"
278 3 1 2) 278 3 1 2)
279
280 ;; EPC F90 compiler:
281 ;; Error 24 at (2:progran.f90) : syntax error
282 ("Error [0-9]+ at (\\([0-9]*\\):\\([^)\n]+\\))" 2 1)
279 ) 283 )
280 "Alist that specifies how to match errors in compiler output. 284 "Alist that specifies how to match errors in compiler output.
281 Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...]) 285 Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...])
282 If REGEXP matches, the FILE-IDX'th subexpression gives the file name, and 286 If REGEXP matches, the FILE-IDX'th subexpression gives the file name, and
283 the LINE-IDX'th subexpression gives the line number. If COLUMN-IDX is 287 the LINE-IDX'th subexpression gives the line number. If COLUMN-IDX is
446 (defun compilation-mode-font-lock-keywords () 450 (defun compilation-mode-font-lock-keywords ()
447 "Return expressions to highlight in Compilation mode." 451 "Return expressions to highlight in Compilation mode."
448 (nconc 452 (nconc
449 ;; 453 ;;
450 ;; Compiler warning/error lines. 454 ;; Compiler warning/error lines.
451 (mapcar #'(lambda (item) 455 (mapcar (function
452 (list (nth 0 item) 456 (lambda (item)
453 (list (nth 1 item) 'font-lock-warning-face nil t) 457 ;; Prepend "^", adjusting FILE-IDX and LINE-IDX accordingly.
454 (list (nth 2 item) 'font-lock-variable-name-face nil t))) 458 (let ((file-idx (nth 1 item)) (line-idx (nth 2 item)) keyword)
459 (when (numberp line-idx)
460 (setq keyword
461 (cons (list (1+ line-idx) 'font-lock-variable-name-face)
462 keyword)))
463 (when (numberp file-idx)
464 (setq keyword
465 (cons (list (1+ file-idx) 'font-lock-warning-face)
466 keyword)))
467 (cons (concat "^\\(" (nth 0 item) "\\)") keyword))))
455 compilation-error-regexp-alist) 468 compilation-error-regexp-alist)
456 (list 469 (list
457 ;; 470 ;;
458 ;; Compiler output lines. Recognize `make[n]:' lines too. 471 ;; Compiler output lines. Recognize `make[n]:' lines too.
459 '("^\\([A-Za-z_0-9/\.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" 472 '("^\\([A-Za-z_0-9/\.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"