diff lisp/progmodes/cc-fonts.el @ 74009:0588a1acad14

(c-font-lock-declarators): Iff at the top-level or inside a class declaration, use c-at-toplevel-p rather than a variable instantiation to recognise a function declaration. Suggested by Feng Li <fengli@gmail.com>.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 15 Nov 2006 16:31:03 +0000
parents f0343b6fc846
children 3c2d2a326dc2 dbe3f29e61d6
line wrap: on
line diff
--- a/lisp/progmodes/cc-fonts.el	Wed Nov 15 16:30:48 2006 +0000
+++ b/lisp/progmodes/cc-fonts.el	Wed Nov 15 16:31:03 2006 +0000
@@ -897,7 +897,11 @@
 	     "[;,]\\|\\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)