aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2016-09-16 10:47:55 +0000
committerAlan Mackenzie2016-09-16 10:47:55 +0000
commit33f856ba01d13f649cf5c848b322ecb0dbfc02fc (patch)
tree5bceca518117109c5a69cf93066f4abf26fa6cfb
parent7123896626b06c26c4e37839ab41e41980c8f433 (diff)
downloademacs-33f856ba01d13f649cf5c848b322ecb0dbfc02fc.tar.gz
emacs-33f856ba01d13f649cf5c848b322ecb0dbfc02fc.zip
C Mode: Fix mis-fontification of macro invocation as function declaration
This happened with a macro invocation which was followed by a statement block in braces. * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): CASE 11: distinguish between contexts nil and top, being less permissive in the former case. (c-just-after-func-arglist-p): call c-forward-decl-or-cast-1 with context top.
-rw-r--r--lisp/progmodes/cc-engine.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index a1574b23c5a..9bd78fb821f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -8631,8 +8631,10 @@ comment at the start of cc-engine.el for more info."
8631 8631
8632 ;; CASE 11 8632 ;; CASE 11
8633 (when (and got-identifier 8633 (when (and got-identifier
8634 (memq context '(nil top))
8635 (looking-at c-after-suffixed-type-decl-key) 8634 (looking-at c-after-suffixed-type-decl-key)
8635 (or (eq context 'top)
8636 (and eq context nil
8637 (match-beginning 1)))
8636 (if (and got-parens 8638 (if (and got-parens
8637 (not got-prefix) 8639 (not got-prefix)
8638 (not got-suffix) 8640 (not got-suffix)
@@ -9310,7 +9312,7 @@ comment at the start of cc-engine.el for more info."
9310 (c-forward-objc-directive))) 9312 (c-forward-objc-directive)))
9311 9313
9312 (setq id-start 9314 (setq id-start
9313 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))) 9315 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) 'top nil)))
9314 (< id-start beg) 9316 (< id-start beg)
9315 9317
9316 ;; There should not be a '=' or ',' between beg and the 9318 ;; There should not be a '=' or ',' between beg and the