all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#14008: Better autoindent for C++11 code?
@ 2013-03-20 15:38 Andrew Pennebaker
  2019-10-13  8:03 ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Pennebaker @ 2013-03-20 15:38 UTC (permalink / raw)
  To: 14008

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1536 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-07 23:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 15:38 bug#14008: Better autoindent for C++11 code? Andrew Pennebaker
2019-10-13  8:03 ` Stefan Kangas
2019-10-13 18:09   ` Alan Mackenzie
2019-11-03 13:29     ` Stefan Kangas
2019-11-07 18:19       ` Alan Mackenzie
2019-11-07 23:41         ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.