GNU bug report logs - #14008
Better autoindent for C++11 code?

Previous Next

Packages: emacs, cc-mode;

Reported by: Andrew Pennebaker <andrew.pennebaker <at> gmail.com>

Date: Wed, 20 Mar 2013 15:41:01 UTC

Severity: wishlist

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrew Pennebaker <andrew.pennebaker <at> gmail.com>
To: 14008 <at> debbugs.gnu.org
Subject: bug#14008: Better autoindent for C++11 code?
Date: Wed, 20 Mar 2013 11:38:58 -0400
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.