;; 2002- Martin Stjernholm
;; Maintainer: bug-cc-mode@gnu.org
;; Created: 07-Jan-2002
-;; Version: See cc-mode.el
-;; Keywords: c languages oop
+;; Keywords: c languages
+;; Package: cc-mode
;; This file is part of GNU Emacs.
(unless (face-property-instance oldface 'reverse)
(invert-face newface)))))
+(defvar c-annotation-face (make-face 'c-annotation-face)
+ "Face used to highlight annotations in java-mode and other modes that may wish to use it.")
+(set-face-foreground 'c-annotation-face "blue")
+
(eval-and-compile
;; We need the following functions during compilation since they're
;; called when the `c-lang-defconst' initializers are evaluated.
,@(when (c-lang-const c-recognize-<>-arglists)
`(c-font-lock-<>-arglists))
- ;; The first two rules here mostly find occurences that
+ ;; The first two rules here mostly find occurrences that
;; `c-font-lock-declarations' has found already, but not
;; declarations containing blocks in the type (see note below).
;; It's also useful to fontify these everywhere to show e.g. when
'((c-fontify-types-and-refs ((c-promote-possible-types t))
(c-forward-keyword-clause 1)
(if (> (point) limit) (goto-char limit))))))))
+
+ ,@(when (c-major-mode-is 'java-mode)
+ `((eval . (list "\\<\\(@[a-zA-Z0-9]+\\)\\>" 1 c-annotation-face))))
))
(c-lang-defconst c-matchers-1
(defun c-find-invalid-doc-markup (regexp limit)
;; Used to fontify invalid markup in doc comments after the correct
- ;; ones have been fontified: Find the first occurence of REGEXP
+ ;; ones have been fontified: Find the first occurrence of REGEXP
;; between the point and LIMIT that only is fontified with
;; `c-doc-face-name'. If a match is found then submatch 0 surrounds
;; the first char and t is returned, otherwise nil is returned.