aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-11-15 16:31:03 +0000
committerChong Yidong2006-11-15 16:31:03 +0000
commit39f7186cefe8cd96577f8f0b26190a0a339e373f (patch)
tree7d57d144fde5697d2c1065b40f9c6272a74c625d
parentbf5546acd05573b2b179edada3b785ed200faed7 (diff)
downloademacs-39f7186cefe8cd96577f8f0b26190a0a339e373f.tar.gz
emacs-39f7186cefe8cd96577f8f0b26190a0a339e373f.zip
(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>.
-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."
897 "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) 897 "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
898 898
899 (setq next-pos (match-beginning 0) 899 (setq next-pos (match-beginning 0)
900 id-face (if (eq (char-after next-pos) ?\() 900 id-face (if (and (eq (char-after next-pos) ?\()
901 (let (c-last-identifier-range)
902 (save-excursion
903 (goto-char next-pos)
904 (c-at-toplevel-p))))
901 'font-lock-function-name-face 905 'font-lock-function-name-face
902 'font-lock-variable-name-face) 906 'font-lock-variable-name-face)
903 got-init (and (match-beginning 1) 907 got-init (and (match-beginning 1)