From: Chong Yidong Date: Wed, 15 Nov 2006 16:31:03 +0000 (+0000) Subject: (c-font-lock-declarators): Iff at the top-level or inside a class X-Git-Tag: emacs-pretest-22.0.91~53 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=39f7186cefe8cd96577f8f0b26190a0a339e373f;p=emacs.git (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 . --- 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)