From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Pennebaker Newsgroups: gmane.emacs.bugs Subject: bug#14008: Better autoindent for C++11 code? Date: Wed, 20 Mar 2013 11:38:58 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9399de33c848a04d85d05c5 X-Trace: ger.gmane.org 1363793968 5855 80.91.229.3 (20 Mar 2013 15:39:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Mar 2013 15:39:28 +0000 (UTC) To: 14008@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 20 16:39:54 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UIL7K-0004AT-48 for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Mar 2013 16:39:54 +0100 Original-Received: from localhost ([::1]:51141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIL6w-0006CY-Qo for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Mar 2013 11:39:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIL6o-00061P-Kt for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:39:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIL6j-0008Pq-8n for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:39:22 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIL6j-0008Pj-5b for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:39:17 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UIL8P-0004cR-RK for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Pennebaker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Mar 2013 15:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14008 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136379405817743 (code B ref -1); Wed, 20 Mar 2013 15:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Mar 2013 15:40:58 +0000 Original-Received: from localhost ([127.0.0.1]:37798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIL8L-0004c7-5b for submit@debbugs.gnu.org; Wed, 20 Mar 2013 11:40:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45999) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIL8J-0004c0-16 for submit@debbugs.gnu.org; Wed, 20 Mar 2013 11:40:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIL6a-0008OO-44 for submit@debbugs.gnu.org; Wed, 20 Mar 2013 11:39:09 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:60097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIL6a-0008OK-1v for submit@debbugs.gnu.org; Wed, 20 Mar 2013 11:39:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIL6U-0005bm-Oi for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:39:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIL6R-0008Mo-DD for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:39:02 -0400 Original-Received: from mail-ia0-x232.google.com ([2607:f8b0:4001:c02::232]:61163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIL6R-0008MT-9I for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 11:38:59 -0400 Original-Received: by mail-ia0-f178.google.com with SMTP id r13so474614iar.9 for ; Wed, 20 Mar 2013 08:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=LE2VCbonnVxQhB7CWDVTeUZbDVyk9MoqUSqojicnrRU=; b=irQQzsS54T72fSm/h4zzLLEnmNG5gqRm39cC2gY4jBWuIxvXhIV4UNO7yNW8ofixhL f+g3vDGSmW3+VTWKVAotQwnOPmnBrBECwOWaOl/P/qgDxKdmEyQ3hRl4aMeETNPMtqs0 v0L27MHhM7f9wE8ehsoiRljKKRIz4Jp4jNfNvlTR9ZvrmWml4XAu7LWD865YlKTuJqwG KoW0BbkrmWrJLPdqSY0n6dQaAlyPHdG489HNsFVklfwI761h1fcT/JVIibqIKvb+5pld TwSmMUA+4uDDGWq3o1VXEipvhrsBxavC+j1qaMPhW37c0MakuvGs3LBH3jsXaWSqblkn zO9Q== X-Received: by 10.50.236.100 with SMTP id ut4mr1781363igc.86.1363793938244; Wed, 20 Mar 2013 08:38:58 -0700 (PDT) Original-Received: by 10.42.110.194 with HTTP; Wed, 20 Mar 2013 08:38:58 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72744 Archived-At: --14dae9399de33c848a04d85d05c5 Content-Type: text/plain; charset=ISO-8859-1 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 --14dae9399de33c848a04d85d05c5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
C++11 introduced lambda syntax []() { ... } and other= strange things that Emacs indents strangely.

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

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

Here's another example:

for_each(range.begin(), range.end(), [&= amp;](int i) {
=A0 = =A0 =A0 =A0 =A0 =A0 =A0std::async(
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 launch::async,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [&]() { stri= ngs[i] =3D fizzy(i); }
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 );
=A0 });

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

--
Cheers,

Andrew Pennebak= er
--14dae9399de33c848a04d85d05c5--