Correctly indent C++14 brace lists which are a second argument to a function.
commitfc56bea1420266ea6495a2e74df28349458b6fb0
authorAlan Mackenzie <acm@muc.de>
Thu, 9 Nov 2017 18:34:13 +0000 (9 18:34 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 9 Nov 2017 18:34:13 +0000 (9 18:34 +0000)
treecfd5d9785a0c9b39e32d3ade48c1f0a443efc942
parent9dde8be9cd8dc9defdae282ed24eaf2dd6bf4c31
Correctly indent C++14 brace lists which are a second argument to a function.

In particular, don't indent contained brace lists in "staircase" fashion.
This fixes bug #28623.

* lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): When
testing for being enclosed in parens, recognise also a brace directly
following a comma, as well as a brace being the first thing inside the paren.
Enhance the return value, by indicating when we're directly inside an open
paren.
(c-inside-bracelist-p): Add an extra argument ACCEPT-IN-PARAM which indicates
whether we will accept a bracelist directly inside an open parenthesis.
Simplify the manipulation of PAREN-STATE by dispensing with variable LIM and
using c-pull-open-brace.  Enhance the return value, respecting the new argument.
(c-guess-basic-syntax): Save a copy of the initial parse-state in the new
variable STATE-CACHE.  Use this variable in place of C-STATE-CACHE throughout
the function.  At CASE 7B, call c-inside-bracelist-p with extra argument nil.
At CASE 9, call that function with extra argument t.
lisp/progmodes/cc-engine.el