]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-font-lock-declarators): Iff at the top-level or inside a class
authorChong Yidong <cyd@stupidchicken.com>
Wed, 15 Nov 2006 16:31:03 +0000 (16:31 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 15 Nov 2006 16:31:03 +0000 (16:31 +0000)
declaration, use c-at-toplevel-p rather than a variable instantiation
to recognise a function declaration.  Suggested by Feng Li
<fengli@gmail.com>.

lisp/progmodes/cc-fonts.el

index d8fd78af44dc434dda96b13eac24e80f3fcb6f26..8473eee90a27d3f812b46f6a5f9a22484b758911 100644 (file)
@@ -897,7 +897,11 @@ casts and declarations are fontified.  Used on level 2 and higher."
             "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
 
       (setq next-pos (match-beginning 0)
-           id-face (if (eq (char-after next-pos) ?\()
+           id-face (if (and (eq (char-after next-pos) ?\()
+                            (let (c-last-identifier-range)
+                              (save-excursion
+                                (goto-char next-pos)
+                                (c-at-toplevel-p))))
                        'font-lock-function-name-face
                      'font-lock-variable-name-face)
            got-init (and (match-beginning 1)