From unknown Sun Jun 15 08:57:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27130: c-mode indentation mistreats structs in function arguments Resent-From: Sam Pagenkopf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 May 2017 16:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27130 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 27130@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149607361013756 (code B ref -1); Mon, 29 May 2017 16:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 May 2017 16:00:10 +0000 Received: from localhost ([127.0.0.1]:43530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFN5W-0003Zn-E0 for submit@debbugs.gnu.org; Mon, 29 May 2017 12:00:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFKnp-0008Te-38 for submit@debbugs.gnu.org; Mon, 29 May 2017 09:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFKnj-00082w-4v for submit@debbugs.gnu.org; Mon, 29 May 2017 09:33:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFKnj-00082s-1W for submit@debbugs.gnu.org; Mon, 29 May 2017 09:33:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFKni-0001Ez-3j for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 09:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFKnh-00082H-AJ for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 09:33:38 -0400 Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]:32918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFKnh-00081p-6X for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 09:33:37 -0400 Received: by mail-qt0-x231.google.com with SMTP id t26so49945614qtg.0 for ; Mon, 29 May 2017 06:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=BpZuKGUbvHkFno06/fX2U7Yb5FvVyefMZXPo0af6ce0=; b=A2KrnvokFOu31/eCMcGS02YgwS4kQS+Wpy+hycGwnOj/KPNbI1vsr8FlucunFESqt2 nysOKZYjGxRSKT78d995WSdu/LdW+lxHUU4WyeC2t+fMGblExda1kt98p44rPn0F21y4 hKKMFFO0x94oqN07SDNYrPh0rfWjne74JYPeFle6/UOvVpJjJCQUkEWqjESbEh/pDvt/ bD4YfIWQ+CRvIsi9yHv4tXImsHU3Vp2lZIYHbTMZmFx6L80sI0wdtIafOlWJN/X67w53 fGzCL7zcWiV5zF8uXThyjwk8FjOpGomeweu/a19gtCjCnNVJOkpTi91Mf2WBwPhYqnk9 vqNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BpZuKGUbvHkFno06/fX2U7Yb5FvVyefMZXPo0af6ce0=; b=eLM1gnC6QL2PtwzDdd1hiyXd8HB7h3HGFPL+G8r4MztFNun3JgAeTCpyVmW2SbH+nd CquXYmamXNCY2wwCENafPRRX0UncclrhZyQPPTWejYk1f9LZyjgLYznz8/GNuHxM0eUe uiaDF1EUOQr30kOObjx+/O+bqw5AAzQs1ZJ67oNRYG5TCR759So3/RqQixPGx0g/czu3 f8/eCPmIExlUYHkyjXjEyKWaKEMHR9AButrNPhWPMPjZ0lt2kurTyaFbRrmjj9mfTnsz Ai0qqLQQGhjyv1uY81k/qUfkbFOoweeQvwlKYIsYTNrIwSL3sTMq1dMMel85lTRNzqSm bMaw== X-Gm-Message-State: AODbwcDHNmDSuRCtKxkBoCNb02mt/nUWNaLsQI6exNIy3xJKsPT+agky 06P2VxdnUcqpiatVMUfhJCcUrKxegLB3 X-Received: by 10.237.35.34 with SMTP id h31mr17283502qtc.148.1496064816240; Mon, 29 May 2017 06:33:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.61.113 with HTTP; Mon, 29 May 2017 06:33:35 -0700 (PDT) From: Sam Pagenkopf Date: Mon, 29 May 2017 08:33:35 -0500 Message-ID: Content-Type: multipart/alternative; boundary="001a113c2366eede520550a9bbc5" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Mon, 29 May 2017 12:00:09 -0400 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: -4.0 (----) --001a113c2366eede520550a9bbc5 Content-Type: text/plain; charset="UTF-8" In emacs 25.2.1. Relevant code: draw_add(&battle.draw, (Drawn){ .kind = DRAW_RECT, .size = {40,24}, .pos.border = { .align = {ALIGN_LEFT, ALIGN_TOP}, .dist = 3 } } ); My guess is that it's reading (Drawn){...} as a statement, and the , as the (,) C operator. --001a113c2366eede520550a9bbc5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+SW4gZW1hY3MgMjUuMi4xLjxicj48ZGl2Pjxicj5SZWxldmFudCBjb2Rl Ojxicj48ZGl2Pjxicj7CoMKgwqAgZHJhd19hZGQoJmFtcDtiYXR0bGUuZHJhdywgKERyYXduKXs8 YnI+wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAua2luZCA9IERSQVdfUkVDVCw8YnI+wqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoMKgIC5zaXplID0gezQwLDI0fSw8YnI+wqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgIC5wb3MuYm9yZGVyID0gezxicj7CoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqDCoMKgwqAgLmFsaWduID0ge0FMSUdOX0xFRlQsIEFMSUdOX1RPUH0sPGJyPsKgwqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoCAuZGlzdCA9IDM8YnI+wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCB9 PGJyPsKgwqDCoMKgwqDCoMKgIH08YnI+wqDCoMKgwqDCoMKgwqAgKTs8YnI+PGJyPk15IGd1ZXNz IGlzIHRoYXQgaXQmIzM5O3MgcmVhZGluZyAoRHJhd24pey4uLn0gYXMgYSBzdGF0ZW1lbnQsIGFu ZCB0aGUgLCBhczxicj50aGUgKCwpIEMgb3BlcmF0b3IuPC9kaXY+PC9kaXY+PC9kaXY+DQo= --001a113c2366eede520550a9bbc5-- From unknown Sun Jun 15 08:57:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27130: c-mode indentation mistreats structs in function arguments Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 30 Nov 2020 11:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27130 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: To: Sam Pagenkopf Cc: 27130@debbugs.gnu.org, Alan Mackenzie Received: via spool by 27130-submit@debbugs.gnu.org id=B27130.16067347282269 (code B ref 27130); Mon, 30 Nov 2020 11:13:02 +0000 Received: (at 27130) by debbugs.gnu.org; 30 Nov 2020 11:12:08 +0000 Received: from localhost ([127.0.0.1]:53718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjh6G-0000aX-1S for submit@debbugs.gnu.org; Mon, 30 Nov 2020 06:12:08 -0500 Received: from quimby.gnus.org ([95.216.78.240]:34826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjh6E-0000Zu-13 for 27130@debbugs.gnu.org; Mon, 30 Nov 2020 06:12:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7FORfGmMsb9r5zqW2JGTXEs37eLt7VoMFcHR5fErNZg=; b=SJuNRhQG3385cvvcja+I1vzzU1 cJuUJlsBKZfvFpZVLqlEeJOciIee/ZqeUkupEwwPtgncXHUnjV2s/DdX9W4Q6BpJeWHx967ktG+13 G88erMlnqi6WAFo9mvRQd5M/Z5k6rGywYraRblFHl9vsDBl8cZjAlNbsbBQ8pLnVje7o=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjh65-00086j-M6; Mon, 30 Nov 2020 12:12:00 +0100 From: Lars Ingebrigtsen References: X-Now-Playing: Yukihiro Takahashi's _Saravah!_: "C'est Si Bon" Date: Mon, 30 Nov 2020 12:11:56 +0100 In-Reply-To: (Sam Pagenkopf's message of "Mon, 29 May 2017 08:33:35 -0500") Message-ID: <87zh2zaykj.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sam Pagenkopf writes: > In emacs 25.2.1. > > Relevant code: > > draw_add(&battle.draw, (Drawn){ > .kind = DRAW_RECT, > .size = {40,24}, > .pos.border = { > .align = {ALIGN_LEFT, ALIGN_TOP}, > .dist = 3 > } > } > ); > > My [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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 (-) Sam Pagenkopf writes: > In emacs 25.2.1. > > Relevant code: > > draw_add(&battle.draw, (Drawn){ > .kind = DRAW_RECT, > .size = {40,24}, > .pos.border = { > .align = {ALIGN_LEFT, ALIGN_TOP}, > .dist = 3 > } > } > ); > > My guess is that it's reading (Drawn){...} as a statement, and the , as > the (,) C operator. I'm not sure how this should be indented (as I didn't even know that that was valid C). But that does look wrong, in any case. (I've confirmed that it indents it the same way in Emacs 28.) Alan? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 30 06:12:12 2020 Received: (at control) by debbugs.gnu.org; 30 Nov 2020 11:12:12 +0000 Received: from localhost ([127.0.0.1]:53721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjh6K-0000an-9j for submit@debbugs.gnu.org; Mon, 30 Nov 2020 06:12:12 -0500 Received: from quimby.gnus.org ([95.216.78.240]:34842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjh6I-0000aM-Q8 for control@debbugs.gnu.org; Mon, 30 Nov 2020 06:12:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Olh8SfGQYdvTJ1L4ulTsmEV8CX0tG9mQ2n5I853Uo1w=; b=ZpqgwET5QG0qohjepimSuJhwm+ 6OMjxt/jn6EziUiz9bDp3zCISeOUYeRkuk4dwB+OlQqLorfICMSbs9KF0XNFIaIxtkxgyZxIt9nAB 9oVE94tMpwsxHJ20eLmsUJEY7em3D4S5HunBSnr2ma2H034CHYGC52hP8PmoVKpxO3q4=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjh6B-00086t-3P for control@debbugs.gnu.org; Mon, 30 Nov 2020 12:12:05 +0100 Date: Mon, 30 Nov 2020 12:12:02 +0100 Message-Id: <87y2ijaykd.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #27130 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 27130 + confirmed quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 (-) tags 27130 + confirmed quit From unknown Sun Jun 15 08:57:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27130: c-mode indentation mistreats structs in function arguments Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 30 Nov 2020 17:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27130 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: confirmed To: Lars Ingebrigtsen Cc: Sam Pagenkopf , 27130@debbugs.gnu.org, acm@muc.de Received: via spool by 27130-submit@debbugs.gnu.org id=B27130.160675589911392 (code B ref 27130); Mon, 30 Nov 2020 17:05:02 +0000 Received: (at 27130) by debbugs.gnu.org; 30 Nov 2020 17:04:59 +0000 Received: from localhost ([127.0.0.1]:56500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjmbU-0002xQ-7Y for submit@debbugs.gnu.org; Mon, 30 Nov 2020 12:04:59 -0500 Received: from colin.muc.de ([193.149.48.1]:59162 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kjmbS-0002xB-Eh for 27130@debbugs.gnu.org; Mon, 30 Nov 2020 12:04:43 -0500 Received: (qmail 88650 invoked by uid 3782); 30 Nov 2020 17:04:35 -0000 Received: from acm.muc.de (p4fe15abb.dip0.t-ipconnect.de [79.225.90.187]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 30 Nov 2020 18:04:34 +0100 Received: (qmail 10024 invoked by uid 1000); 30 Nov 2020 17:04:34 -0000 Date: Mon, 30 Nov 2020 17:04:34 +0000 Message-ID: References: <87zh2zaykj.fsf@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zh2zaykj.fsf@gnus.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) 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, Lars. On Mon, Nov 30, 2020 at 12:11:56 +0100, Lars Ingebrigtsen wrote: > Sam Pagenkopf writes: > > In emacs 25.2.1. > > Relevant code: > > draw_add(&battle.draw, (Drawn){ > > .kind = DRAW_RECT, > > .size = {40,24}, > > .pos.border = { > > .align = {ALIGN_LEFT, ALIGN_TOP}, > > .dist = 3 > > } > > } > > ); > > My guess is that it's reading (Drawn){...} as a statement, and the , as > > the (,) C operator. > I'm not sure how this should be indented (as I didn't even know that > that was valid C). But that does look wrong, in any case. (I've > confirmed that it indents it the same way in Emacs 28.) > Alan? That's strange. In my Emacs 28 copy, I get this indentation: int main () { draw_add(&battle.draw, (Drawn){ .kind = DRAW_RECT, .size = {40,24}, .pos.border = { .align = {ALIGN_LEFT, ALIGN_TOP}, .dist = 3 } } ); } , which apart from the closing parenthesis being indented too far, looks basically OK. Possibly, one might want the .kind line indented one space further (it is indented 2 * c-basic-offset from the draw_add on the previous line). C-c C-s on that line gives the following analysis: ((arglist-cont-nonempty 19 27) (brace-list-intro 19)) . C-c C-s on the following line should give ((brace-list-entry 63)) , where 63 is the position of the . in .kind. This is correct. In fact, something in this area was corrected in the last three or four years, The closing paren is lined up by c-align-arglist-close-under-paren, which contains a bit of DWIMery which misfires here, causing the ) to be indented c-basic-offset from the first character on the line opening the construct (here the draw_add line). This DWIMery has also recently misfired on a C++ file, so I think I'll have to modernise c-align-arglist-close-under-paren to be more discerning. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From unknown Sun Jun 15 08:57:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27130: c-mode indentation mistreats structs in function arguments Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 02 Dec 2020 09:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27130 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: confirmed To: Alan Mackenzie Cc: Sam Pagenkopf , 27130@debbugs.gnu.org Received: via spool by 27130-submit@debbugs.gnu.org id=B27130.16069029418007 (code B ref 27130); Wed, 02 Dec 2020 09:56:01 +0000 Received: (at 27130) by debbugs.gnu.org; 2 Dec 2020 09:55:41 +0000 Received: from localhost ([127.0.0.1]:34262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkOrN-000255-3W for submit@debbugs.gnu.org; Wed, 02 Dec 2020 04:55:41 -0500 Received: from quimby.gnus.org ([95.216.78.240]:58566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkOrJ-00024o-C5 for 27130@debbugs.gnu.org; Wed, 02 Dec 2020 04:55:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OjCMzlvF+Bq9aDydDRX4JgH72wy+xojO+fHy++xOeME=; b=i32GAJnc/QRCT8RvjcmJjEoAnp NGeSILhDtuK4t8wfNLJBlxy9MTWTllwYFJTBbWWuq/mbyvOqTqcbeechahNWj/Cqe1pr9A82DU62P /Z5eLXDOnRmmN7oGqYQm77jMRqsRSzSc+zDl4+6Cg3PYqk3LYFu7api06XX9IpLjqkP4=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkOrA-0004ZZ-8Z; Wed, 02 Dec 2020 10:55:30 +0100 From: Lars Ingebrigtsen References: <87zh2zaykj.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXp5OKzpqKKeHVS PTv///9X6rKaAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+QMAgklKYtopboAAAGSSURBVDjLbZMLtsMg CETRbgBxA4obaHT/e3sDfpK2j9M0jdeBwRIKhEiNI9OJqBTJnwNAuUHoADP+UZDnyh8gKGUqW1G+ FMl3tvJRY6Zi/gV8in+DsH7m8lVjg1hiXbs5WY0bhLqyjMofYKUKqfWCzn8AtTau/xQkBsZxFesG quMNgM7hg5I8wRWbAQ+AGlaqBlDQudQFcIMpzjiPUQRZUtIKoC5lsh1SAXBXRLxCQrUA0EZNwTLJ AlXQc0hpDBgj3y72SSpFVNjAFUhPgFbp6qAracfjXAbIVdMGQ+b+jgvZsM2AzAY5ApinLuJgnLPS 1n3SNNdsQE2BC+m6tX5AWwqYtWGJAJeDtP5o1LT5enVpVzup7shdxgTVgWUh+3r1tEAhq30GyhQz +LFqrq8b8BqzBdpcv4j4U6ELuCLcoLbu4E3TLq3X5AA2EA1M1auOCeirxgY2u/xk+QBbfXQC0JZb 4mcy1d0epsT9LMdNp8KWps8FJG/F7ANgn8nYbu10Yc1f9gO6vxrknoN747COMPEfhaRNUtUweIMA AAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMTItMDJUMDk6Mzc6NDErMDA6MDBEeQz4AAAAJXRFWHRk YXRlOm1vZGlmeQAyMDIwLTEyLTAyVDA5OjM3OjQxKzAwOjAwNSS0RAAAAABJRU5ErkJggg== X-Now-Playing: David Sylvian's _Brilliant Trees_: "Red Guitar" Date: Wed, 02 Dec 2020 10:55:26 +0100 In-Reply-To: (Alan Mackenzie's message of "Mon, 30 Nov 2020 17:04:34 +0000") Message-ID: <871rg85y7l.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > Hello, Lars. > > On Mon, Nov 30, 2020 at 12:11:56 +0100, Lars Ingebrigtsen wrote: >> Sam Pagenkopf writes: > >> > In emacs 25.2.1. > >> > Relevant code: > >> > draw_add(&battle.d [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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: > Hello, Lars. > > On Mon, Nov 30, 2020 at 12:11:56 +0100, Lars Ingebrigtsen wrote: >> Sam Pagenkopf writes: > >> > In emacs 25.2.1. > >> > Relevant code: > >> > draw_add(&battle.draw, (Drawn){ >> > .kind = DRAW_RECT, >> > .size = {40,24}, >> > .pos.border = { >> > .align = {ALIGN_LEFT, ALIGN_TOP}, >> > .dist = 3 >> > } >> > } >> > ); > >> > My guess is that it's reading (Drawn){...} as a statement, and the , as >> > the (,) C operator. > >> I'm not sure how this should be indented (as I didn't even know that >> that was valid C). But that does look wrong, in any case. (I've >> confirmed that it indents it the same way in Emacs 28.) > >> Alan? > > That's strange. In my Emacs 28 copy, I get this indentation: > > int main () > { > draw_add(&battle.draw, (Drawn){ > .kind = DRAW_RECT, > .size = {40,24}, > .pos.border = { > .align = {ALIGN_LEFT, ALIGN_TOP}, > .dist = 3 > } > } > ); > } > > , which apart from the closing parenthesis being indented too far, looks > basically OK. I was thinking the next-to-last } was in a somewhat odd place (the one that closes the Drawn), but on the other hand I don't really know where else it should be. On the third hand... int main () { draw_add(&battle.draw, (Drawn) { .kind = DRAW_RECT, .size = {40,24}, .pos.border = { .align = {ALIGN_LEFT, ALIGN_TOP}, .dist = 3 } } ); } Now the end brace looks correct to me. So perhaps it should be indented the same way in the original case? That is: int main () { draw_add(&battle.draw, (Drawn) { .kind = DRAW_RECT, .size = {40,24}, .pos.border = { .align = {ALIGN_LEFT, ALIGN_TOP}, .dist = 3 } } ); } I'm talking about the braces only -- as you point out, the end parenthesis is a different matter. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no