From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 14 13:16:36 2015 Received: (at submit) by debbugs.gnu.org; 14 Feb 2015 18:16:36 +0000 Received: from localhost ([127.0.0.1]:44128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMhGd-0005iT-FR for submit@debbugs.gnu.org; Sat, 14 Feb 2015 13:16:36 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:38868) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMgrV-00057B-7w for submit@debbugs.gnu.org; Sat, 14 Feb 2015 12:50:38 -0500 Received: by pdbfp1 with SMTP id fp1so21716002pdb.5 for ; Sat, 14 Feb 2015 09:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=U6KJg7bMGE5psLP4fmFFgrilFisMYrb3V5KrGL1vE6E=; b=dixcabT3ungkWGJmnmfwd8WvFc1mqISUfA/pEnIn06B93MWAjlXquNGaUh1ExACAVx UdvlXQO8lg9Bx33fVtQc74aG/lk/pU2hEdqQavT09XrqhvjNFBJJnmZhKBn2T/CqF8fm Q//J9g7bOA3VF73MRnBfXP1DEX83WPvhrJxS1kRpfuvzxDb0kKILNYmF6oVA/8u4B/7W TsVMYsL29BaOGYsE84umJPs8nQEvuGAanS1yE0wCC2+uFzctlVSx2TzMMsNH8WbcYpkY 74VsotNNKm3/GuDJX3ZUwlYgNU03JF0fCcnHBpcLMyHQ5TP6BGceGl0Xn7PqH74Un0s6 JLbg== MIME-Version: 1.0 X-Received: by 10.68.200.97 with SMTP id jr1mr25029773pbc.123.1423936231359; Sat, 14 Feb 2015 09:50:31 -0800 (PST) Received: by 10.70.112.195 with HTTP; Sat, 14 Feb 2015 09:50:31 -0800 (PST) Date: Sat, 14 Feb 2015 12:50:31 -0500 Message-ID: Subject: c++-mode indentation issues with C++1x initializer lists From: Simon To: submit@debbugs.gnu.org Content-Type: multipart/alternative; boundary=047d7b10cef340cb22050f0ffd4c X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 14 Feb 2015 13:16:33 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: turner25@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) --047d7b10cef340cb22050f0ffd4c Content-Type: text/plain; charset=UTF-8 Package: emacs Version: 24.4.1 Severity: important Related: c++-mode Initializer lists use curly braces, but their contents do not indent properly with emacs' c++-mode. In short, one may use an initializer list to declare and initialize a vector of integers as such: std::vector Foo( { 1, 2, 3, 4, 5 } ); Problems arise when the elements of the list span on multiple line and it gets even worse when the elements are lambda-expressions and nested initializer lists. The following code illustrate most cases and related situations. The code below compiles without error or warning with gcc 4.8.3. In case email systems mess with the spaces, the code below is available at this URL as well: http://next.n32.ca/emacs_initlist_indentation_bug.txt #include #include namespace emacs_initlist_indentation_bug { struct ABC { int a; // OK, text-book indentation int b; // int c; // }; struct DEF { int d, // e, // indented from "int" + 2 f; // }; struct GHI { int // g, // indented from "int" +0 h, // indented from "int" + 2 i; // }; int f1 ( int a, // Indentation OK in function declaration context int b, // int c // ) // Notice how the ")" is indented { if(a>0){ return a+ // while out-of-topic, this probably pinpoints b+ // what's going on internally c; // } else if(a<0) { return (a+ // these are well aligned b+ // c); // } else { return (a+ // these are well aligned b+ // c); // } } void f2 (const ABC& abc) { f1(abc.a, // Indentation OK in function call context abc.b, // abc.c); // } void f3 (int a, int b, int c) { f1( f1( a+1, // Indentation OK, text-book example, perfect! b+1, // c+1 ), // f1( a+2, // b+2, // c+2 ), // f1( a+3, // b+3, // c+3 ) // ); // } void f4 (int a, int b, int c) { f2({a+1, // note "{" on same line as "(" b+1, // indented after "{" + 2 c+1} // ); // Bad! ")" indented underneath "(" instead of argument (ie. "{") f2( {a+2, // note "{" on different line as "(" b+2, // indented after "{" + 3 !!! c+2} // ); // OK, ")" indented underneath "{" // Below are some typical indentation I'm getting these days. // The only difference is in the newline on first line (and numerics) std::vector abcList1({{a+1, // b+1, // c+1}, // {a+2, // b+2, // c+2}, // {a+3, // b+3, // c+3} // } // ); // std::vector abcList2( // Source of alignment for closing ")" below {{a+4, // b+4, // c+4}, // {a+5, // b+5, // c+5}, // {a+6, // b+6, // c+6} // } // ); /* Somehow, this one aligns with first line's comment position!! */ } void f5 () { int foo = 0; std::vector< std::function > lambda_initlist_bug({ // [foo](int x) // { // BAD, too indented by 2 positions return x+x; // }, // [foo](int y) // { // BAD, too indented by 2 positions return y+y; // }, // [foo](int z) // { // BAD, too indented by 2 positions return z+z; // } // } ); lambda_initlist_bug.push_back( // [](int p) // OK, text-book indentation { // return p+p; // } // ); /* Aligned with first comment! */ for(auto f_lambda : lambda_initlist_bug){ f_lambda( 123 ); } } } --047d7b10cef340cb22050f0ffd4c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Package: emacs
Version: 24.4.1
Severity:= important

Related: c++-mode

<= div>
Initializer lists use curly braces, but their contents d= o not indent properly with emacs' c++-mode.
In short, one may= use an initializer list to declare and initialize a vector of integers as = such:
=C2=A0 std::vector<int> Foo( { 1, 2, 3, 4, 5 } );

Problems arise when the elements of the list span on = multiple line and it gets even worse when the elements are lambda-expressio= ns and nested initializer lists.
The following code illustrate mo= st cases and related situations.=C2=A0 The code below compiles without erro= r or warning with gcc 4.8.3.


In cas= e email systems mess with the spaces, the code below is available at this U= RL as well:
http://next.n32.ca/emacs_initlist_indentation_bug.txt
<= /div>

#include <vector>
#include <functional>

namespace emacs_initlist_indentation_bug {

  struct ABC {
    int a;  // OK, text-book indentation
    int b;  //
    int c;  //
  };

  struct DEF {
    int d, //
      e,   // indented from "int" + 2
      f;   //
  };

  struct GHI {
    int   //
    g,    // indented from "int" +0
      h,  // indented from "int" + 2
      i;  //
  };

  int f1 ( int a,  // Indentation OK in function declaration context
	   int b,  //
	   int c   //
	   )       // Notice how the ")" is indented
  {

    if(a>0){

      return a+  // while out-of-topic, this probably pinpoints
	b+       // what's going on internally=20
	c;       //

    } else if(a<0) {

      return (a+  // these are well aligned
	      b+  //
	      c); //

    } else {

      return=20
	(a+  // these are well aligned
	 b+  //
	 c); //

    }     =20
  }

  void f2 (const ABC& abc)
  {
    f1(abc.a,  // Indentation OK in function call context
       abc.b,  //
       abc.c); //
  }

  void f3 (int a, int b, int c)
  {
    f1( f1( a+1,    // Indentation OK, text-book example, perfect!
	    b+1,    //
	    c+1 ),  //
	f1( a+2,    //
	    b+2,    //
	    c+2 ),  //
	f1( a+3,    //
	    b+3,    //
	    c+3 )   //
	);          //
  }

  void f4 (int a, int b, int c)
  {
    f2({a+1,     // note "{" on same line as "("
	  b+1,   // indented after "{" + 2
	  c+1}   //=20
      );         // Bad! ")" indented underneath "(" in=
stead of argument (ie. "{")
   =20
    f2(
       {a+2,     // note "{" on different line as "("
	   b+2,  // indented after "{" + 3 !!!
	   c+2}  //
       );        // OK, ")" indented underneath "{"
 =20
    // Below are some typical indentation I'm getting these days.
    // The only difference is in the newline on first line (and numerics)
   =20
    std::vector<ABC> abcList1({{a+1, //
	    b+1,                     //
	    c+1},                    //
	  {a+2,                      //
	      b+2,                   //
	      c+2},                  //
	    {a+3,                    //
		b+3,                 //
		c+3}                 //
      }                              //
      );                             //
   =20
    std::vector<ABC> abcList2(                     // Source of align=
ment for closing ")" below
			      {{a+4,               //
				    b+4,           //
				    c+4},          //
				  {a+5,            //
				      b+5,         //
				      c+5},        //
				    {a+6,          //
					b+6,       //
					c+6}       //
			      }                    //
						   ); /* Somehow, this one aligns with first line's comment posit=
ion!! */
   =20
  }

 =20
  void f5 ()
  {
    int foo =3D 0;
    std::vector< std::function<int(int)> >
      lambda_initlist_bug({    //
	  [foo](int x)         //
	    {                  // BAD, too indented by 2 positions
	      return x+x;      //
	    },                 //
	    [foo](int y)       //
	      {                // BAD, too indented by 2 positions
		return y+y;    //
	      },               //
	      [foo](int z)     //
		{              // BAD, too indented by 2 positions
		  return z+z;  //
		}              //
	}
	);
 =20
    lambda_initlist_bug.push_back(              //
				  [](int p)     // OK, text-book indentation
				  {             //
				    return p+p; //
				  }             //
						);  /* Aligned with first comment! */
   =20
    for(auto f_lambda : lambda_initlist_bug){
      f_lambda( 123 );
    }
 =20
  }

}

--047d7b10cef340cb22050f0ffd4c-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 16 14:09:59 2015 Received: (at 19867) by debbugs.gnu.org; 16 Feb 2015 19:09:59 +0000 Received: from localhost ([127.0.0.1]:45591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNR3O-0008Dh-Ua for submit@debbugs.gnu.org; Mon, 16 Feb 2015 14:09:59 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:48202 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNR3N-0008Da-6N for 19867@debbugs.gnu.org; Mon, 16 Feb 2015 14:09:57 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YNR3L-0006zt-Pl; Mon, 16 Feb 2015 14:09:55 -0500 From: Glenn Morris To: turner25@gmail.com Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists References: X-Spook: anarchy David John Oates Cohiba investigation Telex Area X-Ran: KPv)Le^weyUJho)xki.:|UWH|va5ko{I4J%zd^}ZKOsWgS2L0gZ83\}.iVA=Vlm004Z+B~ X-Hue: black X-Attribution: GM Date: Mon, 16 Feb 2015 14:09:55 -0500 In-Reply-To: (Simon's message of "Sat, 14 Feb 2015 12:50:31 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19867 Cc: 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Simon wrote: > Severity: important Unless it leads to invalid code (eg Python-style languages), I tend to think of indentation bugs as minor problems, since it's just cosmetic. Why do you think this one is important? From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 16 14:29:45 2015 Received: (at 19867) by debbugs.gnu.org; 16 Feb 2015 19:29:45 +0000 Received: from localhost ([127.0.0.1]:45620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNRMW-0001fC-PL for submit@debbugs.gnu.org; Mon, 16 Feb 2015 14:29:45 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:45943) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNRMU-0001ez-Bu for 19867@debbugs.gnu.org; Mon, 16 Feb 2015 14:29:44 -0500 Received: by pablf10 with SMTP id lf10so510251pab.12 for <19867@debbugs.gnu.org>; Mon, 16 Feb 2015 11:29:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=IX66xTfnqQMr2BGCSxIlI5/CcCfquzaHeq4rOAC8upo=; b=ZGDvwGcilsNSXYeQNmtWGWcwRBi3T+bd/QzPVA+Q0Belk6KIsnU+My5P/PNTLy5ONM 5zP3IgmlyKm1r3UXzac35k39AUn28HIJXheDcqVsPJ7S8+fgt5SoyTn1W7GsXAMuv3wD FvhFqzHLcQ1z6KkST7ksbzo/oOfUOuf4ouKLGsnZ6rMUk7SS1fM3TuFcIvXcoZhMZpzi Q3OPM3HZydNvdckm8W7m05xrj/JgfNV/pjl6H162SzR7LvOpe14kUoVkxqKOD2Lz+jJC 1L7Lum7TMGzwNld/9+Lov9qDyYU1wqOL39jbiahBHXjj9Crg+FGvXmDV/9nLFRgri/SE yxdg== MIME-Version: 1.0 X-Received: by 10.70.34.177 with SMTP id a17mr42308859pdj.123.1424114976522; Mon, 16 Feb 2015 11:29:36 -0800 (PST) Received: by 10.70.112.195 with HTTP; Mon, 16 Feb 2015 11:29:36 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Feb 2015 14:29:36 -0500 Message-ID: Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists From: Simon To: Glenn Morris Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 19867 Cc: 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: turner25@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) On Mon, Feb 16, 2015 at 2:09 PM, Glenn Morris wrote: > Simon wrote: > >> Severity: important > > Unless it leads to invalid code (eg Python-style languages), I tend to > think of indentation bugs as minor problems, since it's just cosmetic. > Why do you think this one is important? I am inclined to follow your lead. C++ code compiles without errors as I mentioned. The bug affects "c++-mode" and since c++-mode mostly (solely?) affects cosmetics, then the bug makes c++-mode difficult to use. In fact, I have been searching for alternatives, in vain. I would suggest keeping severity as "important" if this report can be assigned more precisely to the "c++-mode" sub-package or group. If not, then you may downgrade to "minor" as you said. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 16 16:03:14 2015 Received: (at 19867) by debbugs.gnu.org; 16 Feb 2015 21:03:14 +0000 Received: from localhost ([127.0.0.1]:45654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNSp0-0006Sc-5G for submit@debbugs.gnu.org; Mon, 16 Feb 2015 16:03:14 -0500 Received: from dancol.org ([96.126.100.184]:38507) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNSoy-0006SM-IV for 19867@debbugs.gnu.org; Mon, 16 Feb 2015 16:03:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=VsqrXNr+fW7qyMmnlVdIAHhplw6mq6eT/ihXlHm1dnk=; b=UhTFrO4QgffozoBV9VCREeSE7htO1koYsFTYuyXMEu8qUpTT4ySIfBvpsx8Bxbe3G2m7CWRcEFiCK9vGr7/uWTyyqo0tjh0t9OhjhJz9nOvSHN6SD3UTGtlEvAhw3ma9GPZZ8GdYPnvpwBZAUnX5jywCwJyMtM5z5HfgCESlKtYR66Vxe/PxGCjtokiSKUm5mvDTUju45R7SUKWumzYGOJUPpZJEEFnX4k0qbsJTnVlm0D5YYDD2YSHLFzIKDD8pA+DGj+3Zxk4l65bJIF6qcAW7NXUR+cSfHVUM0AY75wXdl259nGhEeIVRcaaHtY4efxrf+n/ZhFSSGpHSu8VQIA==; Received: from c-73-221-38-18.hsd1.wa.comcast.net ([73.221.38.18] helo=[192.168.1.174]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YNSow-0000oT-HC; Mon, 16 Feb 2015 13:03:10 -0800 Message-ID: <54E25B0C.101@dancol.org> Date: Mon, 16 Feb 2015 13:03:08 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Glenn Morris , turner25@gmail.com Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tijJraQmrcefgi29bcJ4EmfLPI3fnu5c4" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tijJraQmrcefgi29bcJ4EmfLPI3fnu5c4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 02/16/2015 11:09 AM, Glenn Morris wrote: > Simon wrote: >=20 >> Severity: important >=20 > Unless it leads to invalid code (eg Python-style languages), I tend to > think of indentation bugs as minor problems, since it's just cosmetic. > Why do you think this one is important? Indentation bugs are infuriating because I use electric mode, which means that even if I fix the indentation, the fixes are undone automatically. --tijJraQmrcefgi29bcJ4EmfLPI3fnu5c4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJU4lsMAAoJEN4WImmbpWBlphUQAIKh2r7KQEt2EMjmVQ9wP7NK i8OKnbA7lK7RhfQHRg/QLf2Cg/PwYRsUx61nsRHvLW30Xqvszq/rN8DLEYw7oJSI HEIIqfP13GHLi22z1y76NX78CIiVDAan7KE8JqbIqnglFIZvTmB0dnqDQOmXR567 4kp4yk+ymU7oydlbl14/C7pAXmm+BuZGnBo9nNnAX8qPis7KwRuOscTZKwT+0GM8 IMZUEMTR/Nbh8jVM6c5gInIQrS//1qr3Q43lPSewBsdxd0Bte0JMm0YWe3McYJ4B R/llZG6XCkWavS4OTPohhgn1AGX4B1S08d7CH1Gz1pIpF6b8WKW5Hq1yAaCBtmMw 9W7vciRr1EZCSiPApRahyBe4mdwnMLtr4zuFJi9zkObMBowa7HmilvPSBTSXORSq vXIUVLw+FyVolkuag2vXuxzQ/wtDrrPghKclscvX5V28d2FU6k2/Ggjw70UhoizG DfAGb3syPfReM1+10EOTn6388+3/pDBUpxXssKUIAjZeQWQn0Vphfk+4vl0p/0+e PMS1h9PyhvDRFcDdt/9dtwzh4dJvzauWYJsjHqca55DpIw9lUjGpkIt0azsSKH1U M6S32o5wecVNr4lxpDbLnsr9Rw9n86awYv5xLlzvKadiXmwMm3ZKFGZFveX7Umzp CUDSaoqSZozExb3iLeSf =JcmB -----END PGP SIGNATURE----- --tijJraQmrcefgi29bcJ4EmfLPI3fnu5c4-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 16 16:38:50 2015 Received: (at 19867) by debbugs.gnu.org; 16 Feb 2015 21:38:50 +0000 Received: from localhost ([127.0.0.1]:45669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNTNS-0000kw-0s for submit@debbugs.gnu.org; Mon, 16 Feb 2015 16:38:50 -0500 Received: from dancol.org ([96.126.100.184]:38660) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNTNK-0000kE-GX for 19867@debbugs.gnu.org; Mon, 16 Feb 2015 16:38:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=MFu0adCEibR1woydY4dyuXJgrY1OpONk3ZlPDelNA5Y=; b=g4lfuSC0EL3MLkMrUx7EmKiPWbQYOhAvlp76Gpwy5WZWa6WuvmKqzsccZ4RD2NZ064jiSVuT2P2y17t/4b7JJZd4Oe1LeJ4XTGvR0uY04AjSUDt455A0PVLqH3qugOppRpQwF2nGqQNoBO1CfsdbnVYG5ObCoRa68zuZv7X17D5+VMylIf3Mzip3N+VCDvvez91f2gsRcBMDe9g/h4Dlux5jUTIN3hK1kO5DG6I0EE3Tuq7YbECtBu8iua44b8plZAg12P4svQzS19V8esykExdAFgiulU8b8b9MbL9Iw2T997qEZ2rZZK17U7fpSuuWu6fFbRVaAZibPexs8HtgMQ==; Received: from c-73-221-38-18.hsd1.wa.comcast.net ([73.221.38.18] helo=[192.168.1.174]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YNTNI-0000zv-Qp; Mon, 16 Feb 2015 13:38:40 -0800 Message-ID: <54E2635F.2040104@dancol.org> Date: Mon, 16 Feb 2015 13:38:39 -0800 From: Daniel Colascione User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: turner25@gmail.com, Glenn Morris Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hhvWpPKuU23QBSrxXt6abARFKBxEMTPUS" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hhvWpPKuU23QBSrxXt6abARFKBxEMTPUS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/16/2015 11:29 AM, Simon wrote: > On Mon, Feb 16, 2015 at 2:09 PM, Glenn Morris wrote: >> Simon wrote: >> >>> Severity: important >> >> Unless it leads to invalid code (eg Python-style languages), I tend to= >> think of indentation bugs as minor problems, since it's just cosmetic.= >> Why do you think this one is important? >=20 > I am inclined to follow your lead. C++ code compiles without errors > as I mentioned. >=20 > The bug affects "c++-mode" and since c++-mode mostly (solely?) affects > cosmetics, then the bug makes c++-mode difficult to use. In fact, I > have been searching for alternatives, in vain. >=20 > I would suggest keeping severity as "important" if this report can be > assigned more precisely to the "c++-mode" sub-package or group. If > not, then you may downgrade to "minor" as you said. OP, your best bet is to dive into cc-engine.el and fix it yourself. --hhvWpPKuU23QBSrxXt6abARFKBxEMTPUS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJU4mNfAAoJEN4WImmbpWBlkLYP/0giyVJ3Ya6WDY62j7hl13/Y iwY9flrVNtggE7MFuuwkvq1aOgxfblrPP5OswBse8XeHxuR8pcpaFwqpcQfH6vF0 gWzTBeeGGGmzyWdr4WI7ecBpFiNK9gV7PN+R6qGUMvXkWrmqcY2RZxD++aDv8Qrb hpmBusbY1V0eYQ9zyNTPOVqfhRbOAwbqHbTVDAjHHsPTMV7votzvpjL7lGaESNx7 sMJcBcQsgfxL20CWvRl06A8e7U+W8qCEfAu2KKANx/LeuPEdfDhakdvi2AVAQlhQ 3+T0h3XsLNxLyy/doA2OwWupsutZ2Rcn4RmmDpfSdZP7jLd1XWzQOC+grhv2NESi XpAfosWnJVkZzGdBNgeeO9EeCecyhLqiX8omzRZVqEsvq6hglVXZ/rd8IQM70Rl9 Aa3N+xkIgSR5+7PL0MU6YIJFXU1TqM57aqn4oQw5L7l4+yC6fNGW5goQP7Swuv00 TjH3ynfR0UKjegkMFgUVel6xxWwBv25NbDx532CeKUdQfFAwSWpEEpCBh6Un9tLJ 1Jm39vX7d1sXpgsL3j93I3TB9kIYMfLF/gMVKREwa3b1Ix/m5rscddkExwLqnncm 7uP5zDdq6Ve1mrujK0j/9TrpKh9eyfi078XNa/C/7h1DrcyGsmNfTMeBGA58inFb bDVqY8eR07G6BgnpHGnB =1c9P -----END PGP SIGNATURE----- --hhvWpPKuU23QBSrxXt6abARFKBxEMTPUS-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 17 14:23:39 2015 Received: (at 19867) by debbugs.gnu.org; 17 Feb 2015 19:23:39 +0000 Received: from localhost ([127.0.0.1]:46601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnkA-00035q-Lu for submit@debbugs.gnu.org; Tue, 17 Feb 2015 14:23:38 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:43733 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnk8-00035i-Vp for 19867@debbugs.gnu.org; Tue, 17 Feb 2015 14:23:37 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YNnk8-0007br-5E; Tue, 17 Feb 2015 14:23:36 -0500 From: Glenn Morris To: turner25@gmail.com Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists References: X-Spook: Europol Manfurov AFSPC STARLAN CID investigation AVN X-Ran: h3--|sZ>g~b.b^]rPhKdtaOmtr1HlUhrMuQB5u%ySRnW#)U$WzTOBM+B7Bob'\f^YHww>b X-Hue: black X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 17 Feb 2015 14:23:36 -0500 In-Reply-To: (Simon's message of "Mon, 16 Feb 2015 14:29:36 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19867 Cc: 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) In Emacs, we traditionally reserve severity > normal for failure to build, security issues etc. So I'll downgrade this to normal, but don't worry, because I have seen very little evidence that the severity makes any difference to whether something gets fixed. :), and :( too. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 17 14:23:54 2015 Received: (at control) by debbugs.gnu.org; 17 Feb 2015 19:23:54 +0000 Received: from localhost ([127.0.0.1]:46604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnkQ-00036H-2P for submit@debbugs.gnu.org; Tue, 17 Feb 2015 14:23:54 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:43735 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnkO-00036A-Ft for control@debbugs.gnu.org; Tue, 17 Feb 2015 14:23:52 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YNnkO-0007d2-8Y for control@debbugs.gnu.org; Tue, 17 Feb 2015 14:23:52 -0500 Date: Tue, 17 Feb 2015 14:23:52 -0500 Message-Id: Subject: control message for bug 19867 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) severity 19867 normal From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 17 14:39:18 2015 Received: (at 19867) by debbugs.gnu.org; 17 Feb 2015 19:39:18 +0000 Received: from localhost ([127.0.0.1]:46633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnzJ-0004vR-PD for submit@debbugs.gnu.org; Tue, 17 Feb 2015 14:39:18 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:34628) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnzH-0004vB-AB for 19867@debbugs.gnu.org; Tue, 17 Feb 2015 14:39:15 -0500 Received: by pdjg10 with SMTP id g10so45990362pdj.1 for <19867@debbugs.gnu.org>; Tue, 17 Feb 2015 11:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=8d/R3ZxrKv2Fb6N3mvqMaoM3BmsfrrNCkgTSykUh1Vo=; b=idGio6dAMSoL0YW3bW+as6Elivq0g51BdzoNUcbjXA9kw7x5bMk1rXyku26y2b0klt mw+03PPnI+xq7U/mr8d9NtHZ3t+mq0o8R6BjqNxedTTjbNtfBrRzTfyz2Wy13bHYSauX ay7SJPRdd73uuZl9AlyqfUrrqaZ8UknAPvzVatO2e1rpXkab7V3FrZUUN4qMQXmcfx55 hR7ewIADa3fOWq6Qj6bGKTQ6U/CuQZDhnpaJr2MMt6Q9uCag3Mw+YtSVGhnXGjOWMoKW fD54m4KfxG2eT+nifw1zNRCmn07KbRiwJDvjzZ/ikRswkObRij2q+Wu2WF2PLxQrglsc HvDw== MIME-Version: 1.0 X-Received: by 10.68.200.97 with SMTP id jr1mr51266585pbc.123.1424201949251; Tue, 17 Feb 2015 11:39:09 -0800 (PST) Received: by 10.70.112.195 with HTTP; Tue, 17 Feb 2015 11:39:09 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Feb 2015 14:39:09 -0500 Message-ID: Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists From: Simon To: Glenn Morris Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 19867 Cc: 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: turner25@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) > In Emacs, we traditionally reserve severity > normal for failure to > build, security issues etc. So I'll downgrade this to normal, but don't > worry, because I have seen very little evidence that the severity makes > any difference to whether something gets fixed. :), and :( too. Sounds good. Thank you Glenn. I hope someone can look into this within a year or two. Ideally, before C++17 becomes a reality and swizzles the syntax further with its "concepts lite" and other features. I also noticed some more strange indentation cases with nested constructor initialization lists. I'll be available to test any improvements made and provide more test cases if needed. Thanks again. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 23 09:14:54 2020 Received: (at 19867) by debbugs.gnu.org; 23 Nov 2020 14:14:54 +0000 Received: from localhost ([127.0.0.1]:49589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khCcH-0001tA-RQ for submit@debbugs.gnu.org; Mon, 23 Nov 2020 09:14:54 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]:35443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khCcF-0001sw-5A for 19867@debbugs.gnu.org; Mon, 23 Nov 2020 09:14:52 -0500 Received: by mail-ej1-f48.google.com with SMTP id f23so23522774ejk.2 for <19867@debbugs.gnu.org>; Mon, 23 Nov 2020 06:14:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=Jq1YMdOgM7YUrV63nkIIrPrxgmNSeAhHS03iiy8rEGM=; b=bQMmEsLs87vtwyguZzaUmF4SK9x400RVoSpGJ8TKYzamJB2OGaO2dnLVas1iNfaNKU OxeVA+hPDvfVV4CN8wklomPq3WF2vjg3Be/PQxgu/CnnqVBw3+Pn/181PXfo8P2bLOzy 9YcdI/A+9jNEUAQblQLd3Om7RizdqH3uHGfvbZyQz2U/ZrbBI78Pkla5BWLOiDtmzR2d ZQnFPJS2D3cGhFjXDbOF0+2M+5AzbXWsFI3XDejA2DLv2Vawew613C06+E+M/gDTI8gI /dEMK//097wu5lIPym98mCyckFrb6v7Ae2za9kx+KnRV8RxFR0wuZKqLRBtdinCVpKAu vhTA== X-Gm-Message-State: AOAM533hUEEQl9bGAf4fMxQOZ3JMl/x71zl0mmNByaCCK/j8UVQtVeU1 Wu+xvGeZmPv0NTqPlGoZG7VgdAmFNaUShh72F/k= X-Google-Smtp-Source: ABdhPJxfW6n4KPdEdDw56h6xMYhxRh6ys7+62H0E6HwfvUQcOiBGa2q0riUeHTnJIMs36I+g7C388x48wopFhnoAbfA= X-Received: by 2002:a17:906:614a:: with SMTP id p10mr25880210ejl.312.1606140885400; Mon, 23 Nov 2020 06:14:45 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 23 Nov 2020 09:14:43 -0500 From: Stefan Kangas In-Reply-To: (Simon's message of "Sat, 14 Feb 2015 12:50:31 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Mon, 23 Nov 2020 09:14:43 -0500 Message-ID: Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists To: Alan Mackenzie Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Simon writes: > Initializer lists use curly braces, but their contents do not indent properly with emacs' c++-mode. > In short, one may use an initializer list to declare and initialize a vector of integers as such: > std::vector Foo( { 1, 2, 3, 4, 5 } ); > > Problems arise when the elements of the list span on multiple line and it gets even worse when the elements are lambda-expressions > and nested initializer lists. > The following code illustrate most cases and related situations. The code below compiles without error or warning with gcc 4.8.3. I had a look at the fairly long example provided here, and AFAICT, the indentation is incorrect in the below cases (trimmed down from the original). Some of the examples of incorrect indentation were already fixed. Alan, could you perhaps take a look at this and see if this is something that is fixable? Thanks in advance. #include #include namespace emacs_initlist_indentation_bug { struct DEF { int d, // e, // indented from "int" + 2 f; // }; struct GHI { int // g, // indented from "int" +0 h, // indented from "int" + 2 i; // }; void f4 (int a, int b, int c) { std::vector abcList2( // Source of alignment for closing ")" below {{a+6, b+6, c+6} } // ); /* Somehow, this one aligns with first line's comment position!! */ } lambda_initlist_bug.push_back( // [](int p) // OK, text-book indentation { // return p+p; // } // ); /* Aligned with first comment! */ } } From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 12:54:31 2025 Received: (at 19867) by debbugs.gnu.org; 11 Mar 2025 16:54:31 +0000 Received: from localhost ([127.0.0.1]:45303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ts2sB-0004Hq-0x for submit@debbugs.gnu.org; Tue, 11 Mar 2025 12:54:31 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:45102) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ts2s7-0004HZ-Nt for 19867@debbugs.gnu.org; Tue, 11 Mar 2025 12:54:28 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5e686d39ba2so1558451a12.2 for <19867@debbugs.gnu.org>; Tue, 11 Mar 2025 09:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741712061; x=1742316861; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=fDTIHtf9xL2kATKWWFcYIZz6clOh2CxuFd8z/1mYNTA=; b=hl22GNQ0FkZ9ydvVc+MzbzdjjW9RUvC44LnjBxDGjMyqNoIGDT4DYlLMoQQFLretZ3 JMiIzkQ2N22hoiMY/IRQKbkji7pQvPakXkoHq3C+rliMMVF37kTDX6TkSsmfvFq4lOIS 57CbNk5rDXgCR+GHc/XUCyH1ygwztwinNeQCKoYR61FW91SAyJjqKJfp0zmBc27nHONk Jyd0TlRLu0/I67aMu+YTGABd5hh6x1qS+mRfNdK/yQeYxu4Wpz7wrrDOALB1p8ix9Bg9 GaFWG7uhhXX5MSyCji2F0jHZB10kGUSAuRs16txWMgKqLXX4nC6LvnE26O1qv7jBXLnV vPJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741712061; x=1742316861; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fDTIHtf9xL2kATKWWFcYIZz6clOh2CxuFd8z/1mYNTA=; b=L+eugGYtxAWg+RpFECODmE1zVtVEOrENObVcH/qef6fnov+iSDSNkjjHKwoppDT7rU e0F9w10QOB+TlIri1WSPzPO80qWuKCgsmgD9sbtH9i6RPQ7+29lU/otGNXc5mwkJHFCu FhyQe0rX5uc3FpwyKT6Z/HKEkXk41W69rLL0f5chWVQsw4FncpvuaaL+G1IOfoz8s4He 8b3KYszgqscmpBdINleGmMwbbASOdSVmR3KwjcPA1b0tZ0OpzA9YRYWv/8jXw0hb2qBC qUltiISxTVBdJG7t8QpN5JyYB3dxnRFrCKOAWJSRx6iX2qSXgQaCqP4dGgsTQUgUoC6g +CiA== X-Forwarded-Encrypted: i=1; AJvYcCXDAwlqTBGJ6mov0L9iZoBCKwzYTsUrWFq4Bpa0REgzB34hJN/8vkSo0iinnXb3Tbl6q+AbYQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwNLLGtWDBsjDQTMGUqQZ83p4H1ltQ8ki1O8sb6QLa23vDmRgJT V8TA7DPjEOvzTEGpIUOSDhMbXSj/rJL0lRyShLidOEdA1vAN9MAezNEUe5hki/cwiSaXez07sre bDOONM9oswlRPlLIqsQv6bREE1qs= X-Gm-Gg: ASbGncvxtVaYV80qqSt21z9I4tDSCFM9QbW3dgncb/4N5q+oniWYzjCx1Oo73Fa545y qfnDtCms8QEoxNKIj/IFel6D6Gbo5r9P6tWmzgJxDASRAmAXi6Yh8KhiW+n6LzQWMjSVewFMJXP H5EKmu78UXPPKf/3c/62Y7OqIlBQ== X-Google-Smtp-Source: AGHT+IHo+WAM5xRmWxV/ZkOtN9eS3pwaaC8LyHdlmlP3lQBq3rJKPtmhWjMoUwOXzWJR/G8BLjLaOGJ+b1DH+IYlngs= X-Received: by 2002:a05:6402:1e93:b0:5e6:1a97:7d09 with SMTP id 4fb4d7f45d1cf-5e75e436164mr5555389a12.16.1741712060840; Tue, 11 Mar 2025 09:54:20 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Mar 2025 09:54:20 -0700 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Tue, 11 Mar 2025 09:54:20 -0700 X-Gm-Features: AQ5f1JoM1pINw1NJ2EueM42Nd4eNVkD7X4hqdKWanb3BR9VH9tGOAwkq0egivls Message-ID: Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists To: Alan Mackenzie Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > Simon writes: > >> Initializer lists use curly braces, but their contents do not indent properly with emacs' c++-mode. >> In short, one may use an initializer list to declare and initialize a vector of integers as such: >> std::vector Foo( { 1, 2, 3, 4, 5 } ); >> >> Problems arise when the elements of the list span on multiple line and it gets even worse when the elements are lambda-expressions >> and nested initializer lists. >> The following code illustrate most cases and related situations. The code below compiles without error or warning with gcc 4.8.3. > > I had a look at the fairly long example provided here, and AFAICT, the > indentation is incorrect in the below cases (trimmed down from the > original). Some of the examples of incorrect indentation were already > fixed. > > Alan, could you perhaps take a look at this and see if this is something > that is fixable? Thanks in advance. Alan, any chance you could look into the below cases? Thanks in advance. > #include > #include > > namespace emacs_initlist_indentation_bug { > struct DEF { > int d, // > e, // indented from "int" + 2 > f; // > }; > struct GHI { > int // > g, // indented from "int" +0 > h, // indented from "int" + 2 > i; // > }; > > void f4 (int a, int b, int c) > { > std::vector abcList2( // Source of > alignment for closing ")" below > {{a+6, > b+6, > c+6} > } // > ); /* Somehow, this > one aligns with first line's comment position!! */ > } > > lambda_initlist_bug.push_back( // > [](int p) // OK, text-book indentation > { // > return p+p; // > } // > ); /* Aligned with > first comment! */ > } > } From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 12:54:44 2025 Received: (at control) by debbugs.gnu.org; 11 Mar 2025 16:54:44 +0000 Received: from localhost ([127.0.0.1]:45306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ts2sN-0004IL-Nf for submit@debbugs.gnu.org; Tue, 11 Mar 2025 12:54:44 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:45099) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ts2sK-0004I0-9l for control@debbugs.gnu.org; Tue, 11 Mar 2025 12:54:40 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5e686d39ba2so1558946a12.2 for ; Tue, 11 Mar 2025 09:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741712074; x=1742316874; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=4miBp83y8biM9unHl7zZjEKxci9bq3bgReXwVQZSmtk=; b=Cr4LajdB8IYYMf6HKaSF1M50OzWNkCO9CDE3jmsRAmqLYmb7+FnXsgeJckYjP0pBdx Pi278riJbFM4lokT56aaF9hi8vcNomf74m8WR0B7K9TQp9YzWCNDy8B3S3eVwv15H7ia ZTEhoXHbzcLca+I0CkDIMms4d8qPOH/qGWjicNWXxowFVfjU53wHozqsyutVmKBzeMc4 3KhwAbK9FX8j3/0MxdwjE5c5YJDU5vu0tkF3Hy8HSEraIfvXhNM3x2F2Fuk9IJ1UsqCm 2IDyny3S4lJDObCQT711wpTah4wX779/VrgslFRS1xshEI53JNH9+CveEnOg1tubN9+F hT8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741712074; x=1742316874; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4miBp83y8biM9unHl7zZjEKxci9bq3bgReXwVQZSmtk=; b=QjEa+Y0PjrK8XoTuwUgbOHxraL+jUY1fOEgANdSxODCIA2emUpUyEAQG+PnKHrbp57 otJwHs0Ac6DznERklAEsbgGymyGzokGtrx1Ah7yg8OmYq2UYVPq8FfOrtFK+HE76fJL/ kOXB6O9zd+Zt4Mj3jyaR9xsNWYHethxwaMFSHtwKgxna4tClj13jkIYCzxwbrz3gFa2S 3OZ0/ldF5pwU6KFNr8zjeTS0UY3fw2plF1wttRSshEc4tM0yQkP8tGMaI9THCvaAqtQe AzM1TGZp5tRmPF0D56tRlhugGZLz/1/rzfvg5g+LToFx7YOcj4ZwuSaHL4Xv9qa9fpBW GUhQ== X-Gm-Message-State: AOJu0Yz4nxHsMwoEmxVAzbNtTk5tH4FqF1+N3fSMZM2/JMAVJdCjvmuD NAOsA4i9o9SPwp1jGCspskrMd46sHG3jS3m3nOJ7g/r6JPWq6xUyBFMmAwaCn1hu6ZWXqs/n5Ny pZTrzKZeArHSp9QU9d3EQLjjvILfaZs9d X-Gm-Gg: ASbGncvRqZQzEmk6psuWXJaAjV2O56N9B9uKgc/jjef/fZVDQ64y/64rIffTsv5VGPm ucpbsCM11MeKnbatQMBpnRR9ZlJDMk9Fj08NDXv82/sTh0DWApOeHiNjNbNB655T8sCC25lmiR2 3AochBwp7y+6pUWJAUQCGQx9838A== X-Google-Smtp-Source: AGHT+IFfOpjeTSMp61hs5gpdv46KUI0//j4ogwxQTujwkZwb+aJsXjQPhf7GyHcmrmZT+ECsAUL64EZ6Z1E8/7ylw2k= X-Received: by 2002:a05:6402:40c7:b0:5e6:267c:a6bd with SMTP id 4fb4d7f45d1cf-5e75f98732emr6374922a12.28.1741712073646; Tue, 11 Mar 2025 09:54:33 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Mar 2025 09:54:33 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Tue, 11 Mar 2025 09:54:33 -0700 X-Gm-Features: AQ5f1JrQEV5S1JFqgAgH1lGkVBNRwn50Un3ESkh_1zl4HwepPeIwqU9j3yuSTEc Message-ID: Subject: control message for bug #19867 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 19867 minor quit From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 16:15:47 2025 Received: (at 19867) by debbugs.gnu.org; 11 Mar 2025 20:15:47 +0000 Received: from localhost ([127.0.0.1]:45880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ts60x-0003AG-Aq for submit@debbugs.gnu.org; Tue, 11 Mar 2025 16:15:47 -0400 Received: from mail.muc.de ([193.149.48.3]:36324) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ts60v-00039v-4F for 19867@debbugs.gnu.org; Tue, 11 Mar 2025 16:15:45 -0400 Received: (qmail 61778 invoked by uid 3782); 11 Mar 2025 21:15:36 +0100 Received: from muc.de (pd953a5d8.dip0.t-ipconnect.de [217.83.165.216]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 11 Mar 2025 21:15:35 +0100 Received: (qmail 28951 invoked by uid 1000); 11 Mar 2025 20:15:35 -0000 Date: Tue, 11 Mar 2025 20:15:35 +0000 To: Stefan Kangas Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Stefan. On Tue, Mar 11, 2025 at 09:54:20 -0700, Stefan Kangas wrote: > Stefan Kangas writes: > > Simon writes: > >> Initializer lists use curly braces, but their contents do not indent properly with emacs' c++-mode. > >> In short, one may use an initializer list to declare and initialize a vector of integers as such: > >> std::vector Foo( { 1, 2, 3, 4, 5 } ); > >> Problems arise when the elements of the list span on multiple line and it gets even worse when the elements are lambda-expressions > >> and nested initializer lists. > >> The following code illustrate most cases and related situations. The code below compiles without error or warning with gcc 4.8.3. > > I had a look at the fairly long example provided here, and AFAICT, the > > indentation is incorrect in the below cases (trimmed down from the > > original). Some of the examples of incorrect indentation were already > > fixed. > > Alan, could you perhaps take a look at this and see if this is something > > that is fixable? Thanks in advance. > Alan, any chance you could look into the below cases? Thanks in advance. Yes, I'll do this. Sorry I never replied to your post in 2020. I started looking at the bug then, but somehow didn't get very far with it. Maybe it was because there were so many individual glitches in the report. Thanks for distilling the cases which still remain unfixed. [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 16:23:24 2025 Received: (at 19867) by debbugs.gnu.org; 11 Mar 2025 20:23:24 +0000 Received: from localhost ([127.0.0.1]:45894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ts68J-0003Tx-Us for submit@debbugs.gnu.org; Tue, 11 Mar 2025 16:23:24 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:53759) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ts68G-0003Th-8I for 19867@debbugs.gnu.org; Tue, 11 Mar 2025 16:23:21 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5e033c2f106so6558712a12.3 for <19867@debbugs.gnu.org>; Tue, 11 Mar 2025 13:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741724594; x=1742329394; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=MhnubK2zzms/H8MzJUCBxgwEbRpwhs0PemKiS8nG/0M=; b=MY+zN10o+1nm+7LU9yyMbVCFY96aMzi8nAgLrVNdRAR7cVLt58yDbHSCxlh/MSYgJH zZQmZ+Uwt/eXek5xYmHa4NastCEoX6RCVL+Vp9Gizcz6r3KQRVJsn/PPnHWAVIlFPETw 1wZFi7nznAi0FYXC1rL+sPVp8q0cGJygpuboRB/O/tnVYC+HnrwEMnEcE1rRx52z9Dfm vSif+WHd5Y6RuBgYcn/uC1ZAyz/6g4STt8Ewm9X/k6SV50Qb/Ch2iE6Lu9GcqXsC4BKC IJBD7wjSQbID8DKV5OHR+JXKOzKBMG5MXiDWTzcOWE28/cZ9vljbQgOUhQyeKQLT3BVr 4fvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741724594; x=1742329394; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MhnubK2zzms/H8MzJUCBxgwEbRpwhs0PemKiS8nG/0M=; b=WxnGjZFqtAS3sdZ8t9ZJhf38x8iQM98vf1KmPHQKBXv8SOazkr02GVAI5Kf7pmDYr2 qg2Q48Gxx7zYKNP8JEcmtjlr+Je27FQjrgb6KrCKxYQtMOjYaFRtsaYPPrHSTZBccZFp ksUDGZS4+9oaNyGi4wCYxW/14LZYf/m9bkxcoEwSFFBZCr5qPyKfamIOZcDHGD1ZzDd4 nW3fSI4NEk25yJMRNxgkllgnQLopS5T2Dlf+nEKVDezGd+6s7sKqC5rIEtV70rtg1/pJ uqEz1kT04l4xj25hILi7bwo48bR5j5fbzKuRZTP1zc9l3YSSKXSm7ZJWTyuT9lWD5YfK dVSQ== X-Forwarded-Encrypted: i=1; AJvYcCWlLbK8hYS0Aj698aC8hdjdhxyWFiFVIi8+Xz2LRXd44mHuXvWUS4tRCiQhhyqK28kpSBQXaw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwsGl+NReVlzoxyFtgABGaHRbwocB1iGEQyxAQeEgWZfLAW6oFB rsSCSqVIZd05lPmfsaKYo9YkTfb84jLAD893jdUd+e6Yp3GMW78TD6dNeOFnkEUw2thkskgAbq3 iJL9cBLOnfj6iYbGHE/BtXnujgoE= X-Gm-Gg: ASbGncsKbI9GjzdjIDWP5+t34FzdVer0qRpU1l00yOCmPqXtIGLUx6QRoSVNo8uoDdT btttpwHXzqowrMsyOUr02bW2nDvdDr2zL6Mjd6K/hAlw+Z7rgK8xlNEzfCmciKDgx/uCw5cDoZw qnq7R+5GoZs7+huX/RRwOuNf6Bhofw/+GfqO8Q X-Google-Smtp-Source: AGHT+IF/JWAphyXNl85xu/H+tgo6k4e4am11q5I1SPRnbP/v8zSRbjYrJEjx5Vc0vQjhW6EVUM5ahGJ6ABrweJxq/+g= X-Received: by 2002:a05:6402:d0e:b0:5e7:b015:ad42 with SMTP id 4fb4d7f45d1cf-5e7b015adafmr1217402a12.28.1741724593758; Tue, 11 Mar 2025 13:23:13 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Mar 2025 16:23:13 -0400 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Tue, 11 Mar 2025 16:23:13 -0400 X-Gm-Features: AQ5f1Jp07y4XmXY9CKG_Apx59VywfrPAymLuDxM6ZZqJa0TMh32SxNIfhyXK_GE Message-ID: Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists To: Alan Mackenzie Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > Yes, I'll do this. Sorry I never replied to your post in 2020. I > started looking at the bug then, but somehow didn't get very far with it. > Maybe it was because there were so many individual glitches in the > report. Thanks for distilling the cases which still remain unfixed. Thanks! From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 06:42:47 2025 Received: (at 19867-done) by debbugs.gnu.org; 27 Mar 2025 10:42:48 +0000 Received: from localhost ([127.0.0.1]:47703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txkhD-00072z-66 for submit@debbugs.gnu.org; Thu, 27 Mar 2025 06:42:47 -0400 Received: from mail.muc.de ([193.149.48.3]:29714) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txkhA-00071R-Hq for 19867-done@debbugs.gnu.org; Thu, 27 Mar 2025 06:42:45 -0400 Received: (qmail 32241 invoked by uid 3782); 27 Mar 2025 11:42:36 +0100 Received: from muc.de (p4fe15765.dip0.t-ipconnect.de [79.225.87.101]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 27 Mar 2025 11:42:35 +0100 Received: (qmail 417 invoked by uid 1000); 27 Mar 2025 10:42:35 -0000 Date: Thu, 27 Mar 2025 10:42:35 +0000 To: Stefan Kangas Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867-done Cc: acm@muc.de, Simon , 19867-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Stefan. On Tue, Mar 11, 2025 at 16:23:13 -0400, Stefan Kangas wrote: > Alan Mackenzie writes: > > Yes, I'll do this. Sorry I never replied to your post in 2020. I > > started looking at the bug then, but somehow didn't get very far with it. > > Maybe it was because there were so many individual glitches in the > > report. Thanks for distilling the cases which still remain unfixed. > Thanks! I've just committed a fix (a ~700 line patch ;-), so I think this bug is finally solved. I'm closing the bug with this post. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 09 20:54:19 2025 Received: (at 19867) by debbugs.gnu.org; 10 Apr 2025 00:54:19 +0000 Received: from localhost ([127.0.0.1]:42831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2gBP-0006oH-IM for submit@debbugs.gnu.org; Wed, 09 Apr 2025 20:54:19 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:60748) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u2gBM-0006nx-Jw for 19867@debbugs.gnu.org; Wed, 09 Apr 2025 20:54:17 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5e61375c108so362131a12.1 for <19867@debbugs.gnu.org>; Wed, 09 Apr 2025 17:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744246450; x=1744851250; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=ERBcDp/LJmubf+iE8DzvpBMQLNYQZmeuTCr2Q5ohBnA=; b=OMU2ri3b+MuyNcPf8Lp35KLl6oDFCugY1TmPcUQD6E2wNblfUQeT9kLlAHVPhZafD9 +nl8wKJ8DV4b3P01YKFLYKGhJfpw2MShbX+8jK10+rztMQn0LU7TeHujP6WUqEBAF6vf fNw9aPVeRDmw052cfds8CuhauiHstKfdVD8B0C/as8xu9VRsz4okK2uPdc+bjQH92Zyn l26qtRLnw97sIHSoUpJcjaxaYR8QRlasVZ0S6rbqMfh//CT4Jlyhlt+vv9Q6NRwj7BjH wqjCLpOSTQWVpdDIZ1vF1mKimeLGtxUoinHdv4i2UzIVk2TGqTlCbrCVdDwSFp5ldpPf ninQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744246450; x=1744851250; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ERBcDp/LJmubf+iE8DzvpBMQLNYQZmeuTCr2Q5ohBnA=; b=QhaDojb/TSKfjB9ZI74Cgnq+UD7Fnvzrp/vDIM7kx/ScieB/mPcko27pWNdS/dpu16 M+nTzTvpcbhn8MTgrXZXJtcFtyhnpJwj4kfr5+V4c8surNc0KX+qi3Vep1OHblNBWRh0 n0+jU0EyEi4p82/5SMhVWocsOXzgs6Dt2zsgojOz/ig24KCHcZb2Y8FqAzY+VQXmffOH ejpz3KelkV/GuLQ/k6/Pg77vZAmUqimT32AT1rJm/1kEAhiXzZOqDkWet/Lpgpp1joCU OCUnW9i3zlyfa4VoNpfqPIUqro8GC5/ahIW1dpZxJRETbiVDqE2Uh0DZnU5hurZaEBn9 /6bQ== X-Forwarded-Encrypted: i=1; AJvYcCU/B5qca/sgKIRpWe1iaKjF66bukyHw6ik6wtttp5LwHEZqZ9TJZFLo7LpUw3IZirbEPRIKOw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzqCUA6udy8o98em4DJJ5DhjaL0LTkEXCQ2wVXQLCqh1QHyKoRH XNeHcfWuDyHb4dDV0qox/csae2Q+LARGZUQyshYNupHCVLIf6fYOhwLJAt5IzCafPiviq9ijGWe fihqzUPy107Wj/XlssOK1pY/jzOdOfCJd X-Gm-Gg: ASbGncs7pFXKg9tjR4dSdtzzA3VRZkRWxzo5eI2duGmhs3AAXReIT6utbG5MAaNM5xi jG/G52rU8yXPoHNXJofn6PtUvvOWntF52qXtdqXANtF7IwpEoaBI/isWGrxGbLqN3SnALnqmmZo qMe/to25nHbpB/AsLXFfAy X-Google-Smtp-Source: AGHT+IGHykPvgwAha1PjpIWiaKtHmT1LcmddRuWt0w82635N1bT/MlyACFvgoNJpkSLB8431QhU6qBYX3APRZqZqBs8= X-Received: by 2002:a05:6402:5106:b0:5dc:c9ce:b01b with SMTP id 4fb4d7f45d1cf-5f32c3b9d3fmr234277a12.8.1744246450392; Wed, 09 Apr 2025 17:54:10 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 9 Apr 2025 17:54:09 -0700 Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 9 Apr 2025 17:54:09 -0700 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Wed, 9 Apr 2025 17:54:09 -0700 X-Gm-Features: ATxdqUEAlQeBR0c8XFVNglVwjubOGIw8DQPQM4U76LKdLFAqB-iR-osNozjevxo Message-ID: Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists To: Alan Mackenzie Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > I've just committed a fix (a ~700 line patch ;-), so I think this bug is > finally solved. Thank you! From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 09:43:12 2025 Received: (at 19867) by debbugs.gnu.org; 17 Apr 2025 13:43:12 +0000 Received: from localhost ([127.0.0.1]:46250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5PWJ-0000Qw-Qx for submit@debbugs.gnu.org; Thu, 17 Apr 2025 09:43:12 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:53656) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u5PWF-0000Pz-Bf for 19867@debbugs.gnu.org; Thu, 17 Apr 2025 09:43:08 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-549b159c84cso993539e87.3 for <19867@debbugs.gnu.org>; Thu, 17 Apr 2025 06:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744897381; x=1745502181; darn=debbugs.gnu.org; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=CkpLXLl2KGgWcraeLBpGBadzGZYnVr4oVsJPT+bwiSk=; b=De03dTt3Dks2Zlh2DrFB1BPNvh8eb9mPTQVvfcp4aD3v/KfVoj7J72VPD9u38LlzOF zjJy27aj9VwTA7UcDwj5zrIp8qN/1+yZyNWzuv0JnaII3/h3Fk67Ys1ONqQ+pgn4LlJ4 hHitp9maZ3L/FQ09AJgspWA49o2rOkP3pmg2ikS1rCSygo5pCbWudl8ipiAwrIP2nN98 nKHxKsmb6GOgOicBQye6iJwb74Lxc6PgaTrmLvAJkvfgdcJhrF2YknX9XlfBAfbW5sQE ZqjCV0hNgZaM0HCOAOT0B2W7q+I606CBQ4ayni5ySu+hSw9qJAW6Aq4ygbvF9jEyjw76 GWIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744897381; x=1745502181; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CkpLXLl2KGgWcraeLBpGBadzGZYnVr4oVsJPT+bwiSk=; b=B04Y88KaZBT9I54NQpFIDQ2NIFZ9FVobbuU2f45i85OVY1yl4o3QMm+2Pkyj2agURn R/Inwdz8QVPgGRKQtBMJH2M7SacIKHRuwOZW3/zvQhYQMnsuFfndQ4Ga/XUhyzmanO1T TA3MCU0cvCilJ3XraVjf1ePP+VhwtTkF/odVgwdfYzfQcCBvLor7JQdPQ9cRriwSN4e6 mBtGQ3JSIA27oEzY27LrWXxl9Q0To3192g4ri+jf9QuishZ9UCiinPay45Yyc2BzB16Z EF2dmpTEhTy+mtXMFjMeb4UQlRm9CQxcZl31KEhFMj9D0odZUUEx7X358JxRKNUB2BGb VS/w== X-Forwarded-Encrypted: i=1; AJvYcCULb4ySgdJPu9DWNRbT/t0AOvLEqHtEq9qqKA+7cKHbRNei79/RFSui8BjvbHQLN8ZZWZ9hxQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwKx3oANNFyX28qwB6hgkD+U4B45ChI+OKDhfZGTfwSDZs5sMRH Tj4kfUHahQmJH08IjCb+n1WhSelZMcIHFU8xaGtPp5j4nZoH2LkW X-Gm-Gg: ASbGncs8VQl3iOX/jbfK5frZz9L2Es/ZDr90FU00D6Qu8ZTYK9PYe+hJwU3E5FyHMim HQkQtJnFbnSMd/JHYkDxFZXl9v5ML9qyW5vZVkEhLC7vhBZ/8P0QWkBhIJCuahKbF3k89l+en5j MGdhi5t4xOEt4uwaoQCc99uFsdPAIcJYcdnn3tjoGGMvs4EL29xT2boFIjt0eXDY8nu6gT2lamB 1sIvhOiAPEomuct9beXqxT9PAJy0Pu8ouD4sTCSWJeD9SUB6tJIxps5kCA4QbgNQCLOJtRs3BO6 L4lNMh8ZBse1LNgK9xD2Eke7NR1TBHDoTBwnTPcobAT66+VIHcrJKmQT50zctm1Ef6cNAICFHLX FnCZtfIM/eFzUCtlJMZ/e40nwPCHRZyXUhpGRgG9IaA== X-Google-Smtp-Source: AGHT+IFy0Wzd9XZZvROwWAPYs6sJh20ehTRR+djJ0hQcoo416jM1sTcXxCjds/CXjgxiFgmlvsOE5g== X-Received: by 2002:a05:6512:4022:b0:545:62c:4b29 with SMTP id 2adb3069b0e04-54d64a9d51dmr2198205e87.22.1744897380697; Thu, 17 Apr 2025 06:43:00 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54d3d510b73sm1959050e87.185.2025.04.17.06.43.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Apr 2025 06:43:00 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: bug#19867: c++-mode indentation issues with C++1x initializer lists Message-Id: <4FEB275A-AB42-43AD-9382-ADB6244E3229@gmail.com> Date: Thu, 17 Apr 2025 15:42:59 +0200 To: Alan Mackenzie X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org, Stefan Kangas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thank you for fixing this. A minor oversight in the committed patch, in = cc-align.el: 351 (skip-syntax-backward " \t([{" (c-point 'boi)) This call should probably use `skip-char-backward`, because `\t`, `[`, = and `{` aren't syntax chars. It currently works by accident because of the ` ` and `(` syntax = classes. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 21 16:35:36 2025 Received: (at 19867) by debbugs.gnu.org; 21 Apr 2025 20:35:36 +0000 Received: from localhost ([127.0.0.1]:39389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6xrc-0004nz-43 for submit@debbugs.gnu.org; Mon, 21 Apr 2025 16:35:36 -0400 Received: from mail.muc.de ([193.149.48.3]:56756) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6xrY-0004mx-R1 for 19867@debbugs.gnu.org; Mon, 21 Apr 2025 16:35:33 -0400 Received: (qmail 77605 invoked by uid 3782); 21 Apr 2025 22:35:23 +0200 Received: from muc.de (p4fe150e2.dip0.t-ipconnect.de [79.225.80.226]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 21 Apr 2025 22:35:23 +0200 Received: (qmail 11366 invoked by uid 1000); 21 Apr 2025 20:35:22 -0000 Date: Mon, 21 Apr 2025 20:35:22 +0000 To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists Message-ID: References: <4FEB275A-AB42-43AD-9382-ADB6244E3229@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4FEB275A-AB42-43AD-9382-ADB6244E3229@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org, Stefan Kangas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Mattias. On Thu, Apr 17, 2025 at 15:42:59 +0200, Mattias Engdegård wrote: > Thank you for fixing this. A minor oversight in the committed patch, in cc-align.el: > 351 (skip-syntax-backward " \t([{" (c-point 'boi)) > This call should probably use `skip-char-backward`, because `\t`, `[`, and `{` aren't syntax chars. > It currently works by accident because of the ` ` and `(` syntax classes. Thanks for spotting this and telling me about it. I'll get around to fixing it in the next few days. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 30 14:58:41 2025 Received: (at 19867) by debbugs.gnu.org; 30 Apr 2025 18:58:41 +0000 Received: from localhost ([127.0.0.1]:56945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uACdl-0003Ac-8d for submit@debbugs.gnu.org; Wed, 30 Apr 2025 14:58:41 -0400 Received: from mail.muc.de ([193.149.48.3]:65367) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uACdf-00039Z-9p for 19867@debbugs.gnu.org; Wed, 30 Apr 2025 14:58:36 -0400 Received: (qmail 89217 invoked by uid 3782); 30 Apr 2025 20:58:27 +0200 Received: from muc.de (pd953a273.dip0.t-ipconnect.de [217.83.162.115]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 30 Apr 2025 20:58:27 +0200 Received: (qmail 21057 invoked by uid 1000); 30 Apr 2025 18:58:26 -0000 Date: Wed, 30 Apr 2025 18:58:26 +0000 To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists Message-ID: References: <4FEB275A-AB42-43AD-9382-ADB6244E3229@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org, Stefan Kangas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello again, Mattias. On Mon, Apr 21, 2025 at 20:35:22 +0000, Alan Mackenzie wrote: > On Thu, Apr 17, 2025 at 15:42:59 +0200, Mattias Engdegård wrote: > > Thank you for fixing this. A minor oversight in the committed patch, in cc-align.el: > > 351 (skip-syntax-backward " \t([{" (c-point 'boi)) > > This call should probably use `skip-char-backward`, because `\t`, `[`, and `{` aren't syntax chars. > > It currently works by accident because of the ` ` and `(` syntax classes. > Thanks for spotting this and telling me about it. I'll get around to > fixing it in the next few days. DONE. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu May 15 14:43:24 2025 Received: (at 19867) by debbugs.gnu.org; 15 May 2025 18:43:24 +0000 Received: from localhost ([127.0.0.1]:56127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFdYC-0002mP-84 for submit@debbugs.gnu.org; Thu, 15 May 2025 14:43:24 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:61773) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uFdYA-0002m9-73 for 19867@debbugs.gnu.org; Thu, 15 May 2025 14:43:23 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-54298ec925bso1849596e87.3 for <19867@debbugs.gnu.org>; Thu, 15 May 2025 11:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747334596; x=1747939396; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=pkI0KQHePD5hvV7TDXuvMeUPpv+OywygUTQU15MBTHI=; b=GCgpE00ZTLeYmXcLecFOxo8xmCbt/K00EJqJI2is8sU56W76Yfm081OFDckU9DI9ix f4mc07a1v6zdQk6/qDN/NuqRRSK8rMtTqhW4q2jk4awO5mk9h9+9JtvWvShSM1KVbxby XhgcKLPqF7TuGexH7S1rLitSKZmrTN+zNJx1tNXQF5B3oqXNkI32c1LadT3j7okYnEO3 Yoq6QnL51ipXEmltfkJnRbVgDT45O9w6wQ+zLv0egIk3x+ySyPuUaGjyUkDJiJvQL7kE t5JjXmUMsLUBH5QofJScfMY3JF0KhbpzxckCWBBTxxYDrk7b5s70qYJcZ6HSSKsduzm9 ABEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747334596; x=1747939396; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pkI0KQHePD5hvV7TDXuvMeUPpv+OywygUTQU15MBTHI=; b=vcVpq+W7gAeUAr/9GAnw8LSIUDNWCNFqu6S9ia4f7Gbysy4u57RgPPTHXSN0rMo4dy XsK81fMR8qXDnRq6ehTmDVBwXnJ7GpDgDmDljAE1jQ9PWlcULVR35pJ/Pt2vtwNNkYzY CHoFJLcyRXs4zyt1pLHn+4AFfHNWBQu8L1ndUm7CPWTuTXRBwp+RBK2ruVKhbyA77AjS V/8I4nEL7Wryd32ORZ5hLxNfMzfdAQEPOGH44HtrzcEvVSqLwoFYfRG9sGYLopWoQcAH 0sDVJfRlJRFwvg0MwEMMJBGN2bVSrp3tJ3KvohXzREW5aE74d4iX3hCnEpDLwjRcQ5yf ROJw== X-Forwarded-Encrypted: i=1; AJvYcCWLI5QxNl7W5X9hj7KeKez2rX29jOy9Izpm+jKF50au7O2yoWHzOOHISjYJa/r6K1kW/AMxPQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzyxz4p/Vvxd2RoCXju598QTsFP2aoF3MqfXhK/QXOVctVYp6Gp IN7rV+YNk/H91UiwtXZjI1fDFBVB396spz3wyQsg0psSPiRMBak/fb97FM3oKA== X-Gm-Gg: ASbGncvUVeGf/YL7Vp3iXVoLi3noSvq6T/DvafvzrDYasVlb+kcod50eJqwzrarm1Gn 0ApUQdAWRpYexY/M11Z7eMiOa2MaVrSTVyKkqRDnJhbKRPFPAiaThi3cQArOjSXjpaERmdu+FAM NxhuUzKOIN/g/WPTGk6I8y0sv/iVMg1BQXgMkH1Dg1dmkKJh1A+vnXJQdHT89/TBYH2JNQ7yEQG CnhvQxO543aGOYGoTwhe58dxaaIJO3jpXK7YUdXYBvV6HvB+w8urISr7hYVo9px9/1SbgQsJmiU fJHPWBJmDU09/vcP9YlsJCU03bd3srNgrEE62lVLxrNBoYozGJwdgHiNbTVGlWmIAOoaczKZ/oZ hUxE4HCr1eU+OW2FNVPljJPEMUF3onWhu+QrHrNDzzA== X-Google-Smtp-Source: AGHT+IEin8GDTh/iNwUjbyiWnozM8dUPiwrWO3uqD8EW9o05QAq7wtWi+NbFJU3OKbECqaFNpT55Mw== X-Received: by 2002:a05:6512:258e:b0:54f:c6bb:1a61 with SMTP id 2adb3069b0e04-550e71950fdmr181103e87.4.1747334595681; Thu, 15 May 2025 11:43:15 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-550e702d7bbsm57420e87.188.2025.05.15.11.43.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 May 2025 11:43:15 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer lists From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Thu, 15 May 2025 20:43:15 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <4FEB275A-AB42-43AD-9382-ADB6244E3229@gmail.com> To: Alan Mackenzie X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19867 Cc: Simon , 19867@debbugs.gnu.org, Stefan Kangas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 30 apr. 2025 kl. 20.58 skrev Alan Mackenzie : > DONE. Thank you! From unknown Tue Jun 17 01:32:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 13 Jun 2025 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator