changeset 24512:ca92d7df3b48

* 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.
author Simon Marshall <simon@gnu.org>
date Tue, 23 Mar 1999 15:31:44 +0000
parents 6dbea1df5686
children 2db3b19a94bb
files lisp/font-lock.el
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-lock.el	Tue Mar 23 12:29:30 1999 +0000
+++ b/lisp/font-lock.el	Tue Mar 23 15:31:44 1999 +0000
@@ -2311,7 +2311,7 @@
     ;; Anders Lindgren <andersl@andersl.com> 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 @@
   "Gaudy level highlighting for Java mode.
 See also `java-font-lock-extra-types'.")
 
-;; Regexps written with help from Fred White <fwhite@bbn.com> and
-;; Anders Lindgren <andersl@andersl.com>.
+;; Regexps written with help from Fred White <fwhite@bbn.com>,
+;; Anders Lindgren <andersl@andersl.com> and Carl Manning <caroma@ai.mit.edu>.
 (let* ((java-keywords
 	(eval-when-compile
 	  (regexp-opt
@@ -2816,7 +2816,7 @@
    ;;
    ;; 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 @@
     ;;
     ;; 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 @@
     (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)))
     ;;