diff options
| author | Simon Marshall | 1999-03-23 15:31:44 +0000 |
|---|---|---|
| committer | Simon Marshall | 1999-03-23 15:31:44 +0000 |
| commit | 4d80b2cc0f808c42a78db18301c3adfc38c73020 (patch) | |
| tree | 6b88b435e259d5d8126b35afaad70ee3cf0c3cf1 | |
| parent | f30b349973a8928e1653f8d5cc7cb189713872fe (diff) | |
| download | emacs-4d80b2cc0f808c42a78db18301c3adfc38c73020.tar.gz emacs-4d80b2cc0f808c42a78db18301c3adfc38c73020.zip | |
* 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.
| -rw-r--r-- | lisp/font-lock.el | 14 |
1 files 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'.") | |||
| 2311 | ;; Anders Lindgren <andersl@andersl.com> points out that it is quicker to | 2311 | ;; Anders Lindgren <andersl@andersl.com> points out that it is quicker to |
| 2312 | ;; use MATCH-ANCHORED to effectively anchor the regexp on the left. | 2312 | ;; use MATCH-ANCHORED to effectively anchor the regexp on the left. |
| 2313 | ;; This must come after the one for keywords and targets. | 2313 | ;; This must come after the one for keywords and targets. |
| 2314 | '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:" | 2314 | '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$" |
| 2315 | (beginning-of-line) (end-of-line) | 2315 | (beginning-of-line) (end-of-line) |
| 2316 | (1 font-lock-constant-face))) | 2316 | (1 font-lock-constant-face))) |
| 2317 | ))) | 2317 | ))) |
| @@ -2777,8 +2777,8 @@ See also `java-font-lock-extra-types'.") | |||
| 2777 | "Gaudy level highlighting for Java mode. | 2777 | "Gaudy level highlighting for Java mode. |
| 2778 | See also `java-font-lock-extra-types'.") | 2778 | See also `java-font-lock-extra-types'.") |
| 2779 | 2779 | ||
| 2780 | ;; Regexps written with help from Fred White <fwhite@bbn.com> and | 2780 | ;; Regexps written with help from Fred White <fwhite@bbn.com>, |
| 2781 | ;; Anders Lindgren <andersl@andersl.com>. | 2781 | ;; Anders Lindgren <andersl@andersl.com> and Carl Manning <caroma@ai.mit.edu>. |
| 2782 | (let* ((java-keywords | 2782 | (let* ((java-keywords |
| 2783 | (eval-when-compile | 2783 | (eval-when-compile |
| 2784 | (regexp-opt | 2784 | (regexp-opt |
| @@ -2816,7 +2816,7 @@ See also `java-font-lock-extra-types'.") | |||
| 2816 | ;; | 2816 | ;; |
| 2817 | ;; Fontify class names. | 2817 | ;; Fontify class names. |
| 2818 | '("\\<\\(class\\)\\>[ \t]*\\(\\sw+\\)?" | 2818 | '("\\<\\(class\\)\\>[ \t]*\\(\\sw+\\)?" |
| 2819 | (1 font-lock-type-face) (2 font-lock-function-name-face nil t)) | 2819 | (1 font-lock-keyword-face) (2 font-lock-type-face nil t)) |
| 2820 | ;; | 2820 | ;; |
| 2821 | ;; Fontify package names in import directives. | 2821 | ;; Fontify package names in import directives. |
| 2822 | '("\\<\\(import\\|package\\)\\>[ \t]*\\(\\sw+\\)?" | 2822 | '("\\<\\(import\\|package\\)\\>[ \t]*\\(\\sw+\\)?" |
| @@ -2832,8 +2832,8 @@ See also `java-font-lock-extra-types'.") | |||
| 2832 | ;; | 2832 | ;; |
| 2833 | ;; Fontify class names. | 2833 | ;; Fontify class names. |
| 2834 | `(eval . | 2834 | `(eval . |
| 2835 | (cons (concat "\\<\\(" (,@ java-type-names) "\\)\\>") | 2835 | (cons (concat "\\<\\(" (,@ java-type-names) "\\)\\>[^.]") |
| 2836 | 'font-lock-type-face)) | 2836 | '(1 font-lock-type-face))) |
| 2837 | ;; | 2837 | ;; |
| 2838 | ;; Fontify all builtin keywords (except below). | 2838 | ;; Fontify all builtin keywords (except below). |
| 2839 | (concat "\\<\\(" java-keywords "\\|" java-type-specs "\\)\\>") | 2839 | (concat "\\<\\(" java-keywords "\\|" java-type-specs "\\)\\>") |
| @@ -2842,7 +2842,7 @@ See also `java-font-lock-extra-types'.") | |||
| 2842 | (list "\\<\\(break\\|case\\|continue\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?" | 2842 | (list "\\<\\(break\\|case\\|continue\\|goto\\)\\>[ \t]*\\(-?\\sw+\\)?" |
| 2843 | '(1 font-lock-keyword-face) '(2 font-lock-constant-face nil t)) | 2843 | '(1 font-lock-keyword-face) '(2 font-lock-constant-face nil t)) |
| 2844 | ;; This must come after the one for keywords and targets. | 2844 | ;; This must come after the one for keywords and targets. |
| 2845 | '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:" | 2845 | '(":" ("^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*$" |
| 2846 | (beginning-of-line) (end-of-line) | 2846 | (beginning-of-line) (end-of-line) |
| 2847 | (1 font-lock-constant-face))) | 2847 | (1 font-lock-constant-face))) |
| 2848 | ;; | 2848 | ;; |