From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64133: CC Mode 5.35.2 (C/*l); incorrect indentation for an arrays of structs. Date: Sat, 17 Jun 2023 18:14:34 +0300 Message-ID: <831qiaqfxh.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64133@debbugs.gnu.org To: Jeff Norden Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 17 17:15:16 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qAXdz-0008FE-59 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Jun 2023 17:15:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAXdr-0003T2-B6; Sat, 17 Jun 2023 11:15:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAXdp-0003RV-PB for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 11:15:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAXdm-00072a-0I for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 11:15:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAXdl-0000IJ-Rd for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 11:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Jun 2023 15:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64133 X-GNU-PR-Package: emacs Original-Received: via spool by 64133-submit@debbugs.gnu.org id=B64133.16870148891097 (code B ref 64133); Sat, 17 Jun 2023 15:15:01 +0000 Original-Received: (at 64133) by debbugs.gnu.org; 17 Jun 2023 15:14:49 +0000 Original-Received: from localhost ([127.0.0.1]:52297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAXdZ-0000Hd-14 for submit@debbugs.gnu.org; Sat, 17 Jun 2023 11:14:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAXdU-0000HN-UV for 64133@debbugs.gnu.org; Sat, 17 Jun 2023 11:14:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAXdM-00070S-TA; Sat, 17 Jun 2023 11:14:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=e4XT5dYE71EagPHZvp/4i7fgGsEuSGaArZtm/hM/VD4=; b=CnSlo0sRV6Gr uI3+/ZLmE+airbXtNth0trdWD5tKAx3RGAqFzI7yVI5/BOGhdWJNOIg+7y5zKP0HzM8VVlH/va4fq d2goiN7DH4I/txlYDBK6Dv43eMe0l7a+Qopp8wzcEJfDZh2rR0prEf1Gl+d3ExS2sWgvdz9q3FqxW JKi+IK8YqJJnug2j2W/Q46yTYt3bm9CiARPx1s979bsvc6EBEBw5QFopAGPi8nQi57GOpvMZ1ViMS M66IlXLOkU7tlI5Sz9NjZC0exu0ZXsSk7P8pOAQ5GASWsDlorghNG68MtbuyGdT8mrE8LpXUQZ6Qs GNYs8vNDSqlSlqmiC+RfEA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAXdL-0008SP-BW; Sat, 17 Jun 2023 11:14:35 -0400 In-Reply-To: (message from Jeff Norden on Sat, 17 Jun 2023 10:03:24 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263547 Archived-At: > From: Jeff Norden > Date: Sat, 17 Jun 2023 10:03:24 -0500 > > I've verified the following behavior with c-version 5.35.2 (emacs-29, > and emacs-30 from git) and with 5.35.1 (emacs 28.2). > > Place the following text into a file with a ".c" extension, and load > it with "emacs -Q". > ========================================== > #include > struct three_ints { > int a, b, c; > }; > int main () { > struct three_ints numbers[]= { > {0,1,2}, > {3,4,5}, > {6,7,8} > }; > for (int i=0; i printf("ack "); > } > printf("\n"); > } > ========================================== > Move the cursor to the beginning of the line with {3,4,5} and press > to indent the line. It will be incorrectly indented 2 spaces > more than the previous line. Move to the next line, press , > and you'll see: > > struct three_ints numbers[]= { > {0,1,2}, > {3,4,5}, > {6,7,8} > }; This source code uses the 'linux' indentation style, so you should do M-x c-set-style RET linux RET after which the problem goes away, AFAICT.