]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Fix analysis of brace lists, particularly in C++ Mode
authorAlan Mackenzie <acm@muc.de>
Tue, 2 Mar 2021 20:31:36 +0000 (20:31 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 2 Mar 2021 20:31:36 +0000 (20:31 +0000)
commit8dd588b1fb51bb9178bf34a6be9f35de84e95045
treee42564b6f27d055c16d70bd3b33595ba7b8585ed
parentaa14398aa14362095f1a42845015b9bab141c7d6
CC Mode: Fix analysis of brace lists, particularly in C++ Mode

Fix some alignment functionality in cc-align.el.

* lisp/progmodes/cc-align.el (c-lineup-arglist-intro-after-paren): Align the
next line under the previous entry rather than one to the right of the paren.
(c-lineup-2nd-brace-entry-in-arglist): Take the anchor point from the
brace-list-entry element, not the brace-list-intro one.

* lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Use
c-looking-at-statement-block to test whether "struct A {" begins a brace list
or a struct declaration.
(c-looking-at-or-maybe-in-bracelist): Several detailed amendments, correctly
to recognize brace lists.
(c-looking-at-statement-block): No longer search for commas, as they are not
reliable indicators of a brace list.  Search now for a restricted set of
keywords, since some can appear in brace lists in C++ mode.

* lisp/progmodes/cc-langs.el (c-stmt-block-only-keywords)
(c-stmt-block-only-keywords-regexp): New lang consts/vars.
(c-pre-id-bracelist-kwds): New lang const.
(c-pre-id-bracelist-key): Derive now from the above.
(c-pre-brace-non-bracelist-key): New lang const/var.
lisp/progmodes/cc-align.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-langs.el