Subject: bug#28623: 27.0.50; lisp/progmodes/cc-engine.el incorrect indentation of C++14 curly-brace initializer list

From: Alan Mackenzie <[email-masked]>
Date: Wed, 11 Oct 2017 20:32:21 +0000

Hello, Tadeus.

On Fri, Oct 06, 2017 at 04:59:55 +0200, Tadeus Prastowo wrote:
> On Wed, Oct 4, 2017 at 8:15 PM, Alan Mackenzie <[email-masked]> wrote:

> Hi Alan!

> [...]

> >> Any better suggestion as to how to fix the problem?

> > Hey, I just love it when people diagnose and fix their own bugs,
> > particularly in some of the more involved bits of CC Mode.  :-)

> To make the maintainer's life easier :-)

> > Just one tiny, tiny, nitpick.  in (looking-at ",\\s *"), isn't the "any
> > amount of space" bit redundant, since we don't use match-end to get the
> > precise position?  In fact, I'm tending towards the simpler (eq
> > (char-after) ?,).

> That is surely better.  Please go with that solution.

> > But, as I say, that's a tiny point in a great piece of debugging.  I
> > will commit this (to the Emacs-26 branch of savannah) soon (from where
> > it will find its way to the master branch due to some public spirited
> > person who arranges these things).

> Thank you very much for your review.

> > Many thanks!

> No problem.  I'm glad to help.

I'm sorry is been a week without any communication from me.  The reason
is I've run into problems with other related cases.  For example, in

1.    auto bad4 = f <3> (
2.                       {3, 4},

L2 needs to be parsed as an arglist-intro and indented as shown.  It's
actually being parsed as a brace-list-open with anchor point on "auto".

What's confusing me is the confusion between a brace list being
recognised by its context (which is what
c-looking-at-or-maybe-in-bracelist mostly does) and by its content.  The
{3, 4} above is a brace list by its content but not by its context.
However, it's being wrongly recognised as a by-context brace list, hence
is being parsed and indented wrongly.

I'm not going to have much time to sort this out over the next week or
two, so please bear with me.  I haven't forgotten about this.

> --
> Best regards,
> Tadeus

-- 
Alan Mackenzie (Nuremberg, Germany).