From 39f7186cefe8cd96577f8f0b26190a0a339e373f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 15 Nov 2006 16:31:03 +0000 Subject: [PATCH] (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 . --- lisp/progmodes/cc-fonts.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.39.5