summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorSimon Marshall <simon@gnu.org>1997-02-21 09:42:44 +0000
committerSimon Marshall <simon@gnu.org>1997-02-21 09:42:44 +0000
commite93b2a554147ca9213779fde37caeff989b6dc9a (patch)
treecc35492bb1388997b1ea1b21a0b8e7683c2e076a /lisp
parent56fcbd7e9d76f143abef1c13361efe41052ef59d (diff)
downloademacs-e93b2a554147ca9213779fde37caeff989b6dc9a.tar.gz
emacs-e93b2a554147ca9213779fde37caeff989b6dc9a.tar.bz2
emacs-e93b2a554147ca9213779fde37caeff989b6dc9a.zip
Rewrite Font Lock support.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/compile.el24
1 files changed, 17 insertions, 7 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index ab93cd447ec..be6b2436c38 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1,6 +1,6 @@
;;; compile.el --- run compiler as inferior of Emacs, parse error messages.
-;; Copyright (C) 1985, 86, 87, 93, 94, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@prep.ai.mit.edu>
;; Maintainer: FSF
@@ -309,12 +309,22 @@ write into the compilation buffer, and to put in its mode line.")
;; History of grep commands.
(defvar grep-history nil)
-(defvar compilation-mode-font-lock-keywords
- ;; This regexp needs a bit of rewriting. What is the third grouping for?
- '(("^\\([a-zA-Z]?:?[^ \n:]*:\\([0-9]+:\\)+\\)\\(.*\\)$"
- 1 font-lock-function-name-face))
-;;; ("^\\([^\n:]*:\\([0-9]+:\\)+\\)\\(.*\\)$" 0 font-lock-keyword-face keep)
- "Additional expressions to highlight in Compilation mode.")
+(defun compilation-mode-font-lock-keywords ()
+ "Return expressions to highlight in Compilation mode."
+ (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)))
+ compilation-error-regexp-alist)
+ (list
+ ;;
+ ;; Compiler output lines. Recognise `make[n]:' lines too.
+ '("^\\([A-Za-z_0-9/\.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
+ (1 font-lock-function-name-face) (3 font-lock-comment-face nil t)))
+ ))
;;;###autoload
(defun compile (command)