summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-fonts.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-11-15 16:31:03 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-11-15 16:31:03 +0000
commit39f7186cefe8cd96577f8f0b26190a0a339e373f (patch)
tree7d57d144fde5697d2c1065b40f9c6272a74c625d /lisp/progmodes/cc-fonts.el
parentbf5546acd05573b2b179edada3b785ed200faed7 (diff)
downloademacs-39f7186cefe8cd96577f8f0b26190a0a339e373f.tar.gz
(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>.
Diffstat (limited to 'lisp/progmodes/cc-fonts.el')
-rw-r--r--lisp/progmodes/cc-fonts.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index d8fd78af44d..8473eee90a2 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -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)