]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-fonts.el
merge trunk
[gnu-emacs] / lisp / progmodes / cc-fonts.el
index a31de35f3bac558504aad8c7623feea385ee79b5..c6c8bd107f6798c19d1f6e704aadd259c88618b3 100644 (file)
         (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")
+(defvar c-annotation-face 'c-annotation-face)
+
+(defface c-annotation-face
+  '((default :inherit font-lock-constant-face))
+  "Face for highlighting annotations in Java mode and similar modes."
+  :version "24.1"
+  :group 'c)
 
 (eval-and-compile
   ;; We need the following definitions during compilation since they're
@@ -1207,7 +1211,7 @@ casts and declarations are fontified.  Used on level 2 and higher."
          ;; o - '<> if the arglist is of angle bracket type;
          ;; o - 'arglist if it's some other arglist;
          ;; o - nil, if not in an arglist at all.  This includes the
-         ;;   parenthesised condition which follows "if", "while", etc.
+         ;;   parenthesized condition which follows "if", "while", etc.
          context
          ;; The position of the next token after the closing paren of
          ;; the last detected cast.
@@ -1535,10 +1539,11 @@ casts and declarations are fontified.  Used on level 2 and higher."
   ;; Fontification".
   (let* ((paren-state (c-parse-state))
         (start (point))
+        (bod-lim (max (- (point) 500) (point-min)))
         decl-context bo-decl in-typedef type-type ps-elt)
 
     ;; First, are we actually in a "local" declaration?
-    (setq decl-context (c-beginning-of-decl-1)
+    (setq decl-context (c-beginning-of-decl-1 bod-lim)
          bo-decl (point)
          in-typedef (looking-at c-typedef-key))
     (if in-typedef (c-forward-token-2))