From 4d80b2cc0f808c42a78db18301c3adfc38c73020 Mon Sep 17 00:00:00 2001 From: Simon Marshall Date: Tue, 23 Mar 1999 15:31:44 +0000 Subject: [PATCH] * font-lock.el (c-font-lock-keywords-2): Only fontify a label if it is on the line by itself. (java-font-lock-keywords-2): Likewise. Don't fontify a class name if it is not in a declarative context. --- lisp/font-lock.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index d43690ed2cf..0bfb213fa07 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2311,7 +2311,7 @@ See also `c-font-lock-extra-types'.") ;; Anders Lindgren points out that it is quicker to ;; use MATCH-ANCHORED to effectively anchor the regexp on the left. ;; This must come after the one for keywords and targets. - '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:" + '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$" (beginning-of-line) (end-of-line) (1 font-lock-constant-face))) ))) @@ -2777,8 +2777,8 @@ See also `java-font-lock-extra-types'.") "Gaudy level highlighting for Java mode. See also `java-font-lock-extra-types'.") -;; Regexps written with help from Fred White and -;; Anders Lindgren . +;; Regexps written with help from Fred White , +;; Anders Lindgren and Carl Manning . (let* ((java-keywords (eval-when-compile (regexp-opt @@ -2816,7 +2816,7 @@ See also `java-font-lock-extra-types'.") ;; ;; Fontify class names. '("\\<\\(class\\)\\>[ \t]*\\(\\sw+\\)?" - (1 font-lock-type-face) (2 font-lock-function-name-face nil t)) + (1 font-lock-keyword-face) (2 font-lock-type-face nil t)) ;; ;; Fontify package names in import directives. '("\\<\\(import\\|package\\)\\>[ \t]*\\(\\sw+\\)?" @@ -2832,8 +2832,8 @@ See also `java-font-lock-extra-types'.") ;; ;; Fontify class names. `(eval . - (cons (concat "\\<\\(" (,@ java-type-names) "\\)\\>") - 'font-lock-type-face)) + (cons (concat "\\<\\(" (,@ java-type-names) "\\)\\>[^.]") + '(1 font-lock-type-face))) ;; ;; Fontify all builtin keywords (except below). (concat "\\<\\(" java-keywords "\\|" java-type-specs "\\)\\>") @@ -2842,7 +2842,7 @@ See also `java-font-lock-extra-types'.") (list "\\<\\(break\\|case\\|continue\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?" '(1 font-lock-keyword-face) '(2 font-lock-constant-face nil t)) ;; This must come after the one for keywords and targets. - '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:" + '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$" (beginning-of-line) (end-of-line) (1 font-lock-constant-face))) ;; -- 2.39.2