aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorAlan Mackenzie2013-09-28 17:17:01 +0000
committerAlan Mackenzie2013-09-28 17:17:01 +0000
commit38de11bd5a80cf3de1f0d8dfa90f5faef1c4e2f9 (patch)
tree6e4b2b9178a0fe316249de1c99e8d70c084deb57 /lisp/progmodes/cc-engine.el
parent1610938f74bd8cee71c0190deb470b5bd102d51f (diff)
downloademacs-38de11bd5a80cf3de1f0d8dfa90f5faef1c4e2f9.tar.gz
emacs-38de11bd5a80cf3de1f0d8dfa90f5faef1c4e2f9.zip
Fix indentation/fontification of Java enum with "implements".
* progmodes/cc-langs.el (c-postfix-decl-spec-key): New variable, a regexp which matches "implements", etc., in Java. * progmodes/cc-engine.el (c-inside-bracelist-p): Check for extra specifier clauses coming after "enum". * progmodes/cc-fonts.el (c-font-lock-declarations) (c-font-lock-enum-tail): Check for extra specifier clauses coming after "enum".
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el26
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index ce83efd114b..b3a6a0e3f03 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -8486,17 +8486,21 @@ comment at the start of cc-engine.el for more info."
8486 (or 8486 (or
8487 ;; This will pick up brace list declarations. 8487 ;; This will pick up brace list declarations.
8488 (c-safe 8488 (c-safe
8489 (save-excursion 8489 (save-excursion
8490 (goto-char containing-sexp) 8490 (goto-char containing-sexp)
8491 (c-forward-sexp -1) 8491 (let (before-identifier)
8492 (let (bracepos) 8492 (while
8493 (if (and (or (looking-at c-brace-list-key) 8493 (progn
8494 (progn (c-forward-sexp -1) 8494 (c-forward-sexp -1)
8495 (looking-at c-brace-list-key))) 8495 (cond
8496 (setq bracepos (c-down-list-forward (point))) 8496 ((c-on-identifier) (setq before-identifier t))
8497 (not (c-crosses-statement-barrier-p (point) 8497 ((and before-identifier
8498 (- bracepos 2)))) 8498 (looking-at c-postfix-decl-spec-key))
8499 (point))))) 8499 (setq before-identifier nil)
8500 t)
8501 ((looking-at c-brace-list-key) nil)
8502 (t nil))))
8503 (looking-at c-brace-list-key))))
8500 ;; this will pick up array/aggregate init lists, even if they are nested. 8504 ;; this will pick up array/aggregate init lists, even if they are nested.
8501 (save-excursion 8505 (save-excursion
8502 (let ((class-key 8506 (let ((class-key