bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14008: Better autoindent for C++11 code?


From: Andrew Pennebaker
Subject: bug#14008: Better autoindent for C++11 code?
Date: Wed, 20 Mar 2013 11:38:58 -0400

C++11 introduced lambda syntax []() { ... } and other strange things that Emacs indents strangely.

for_each(range.begin(), range.end(), [=](int i) {
    cout << strings[i] << endl;
  });

I would like the final line `});` to have the same indentation level as the first line `for_each...`.

Here's another example:

for_each(range.begin(), range.end(), [&](int i) {
             std::async(
                        launch::async,
                        [&]() { strings[i] = fizzy(i); }
                        );
  });

The arguments to std::async and its closing parenthesis are indented much too far; I would like them indented only one level further than where std::async is itself indented. Any tips for achieving this?

--
Cheers,

Andrew Pennebaker
www.yellosoft.us

reply via email to

[Prev in Thread] Current Thread [Next in Thread]