Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
74008:eba67440b734 | 74009:0588a1acad14 |
---|---|
895 ;; square brackets, and we treat them as initializers too. | 895 ;; square brackets, and we treat them as initializers too. |
896 (c-syntactic-re-search-forward | 896 (c-syntactic-re-search-forward |
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) |
904 (char-after (match-beginning 1)))) | 908 (char-after (match-beginning 1)))) |
905 | 909 |