From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#29959: cc-mode: wrong indentation in absence of semicolon Date: Thu, 18 Jan 2018 22:08:04 +0300 Message-ID: <7dc2d599-f391-2b0c-2509-ea45a5cf74d4@yandex.ru> References: <8a042ba1-301c-8943-1381-537cba8a2334@yandex.ru> <20180113203752.GA9688@ACM> <20180118184137.GB21934@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1516302443 20603 195.159.176.226 (18 Jan 2018 19:07:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 19:07:23 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 Cc: 29959@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 20:07:19 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecFWm-0004WX-W7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 20:07:09 +0100 Original-Received: from localhost ([::1]:48796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecFYn-0002Aj-2d for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 14:09:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecFYg-0002AU-9U for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 14:09:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecFYc-00080W-6U for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 14:09:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54015) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecFYb-00080O-Vl; Thu, 18 Jan 2018 14:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ecFYb-0000WI-N1; Thu, 18 Jan 2018 14:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 18 Jan 2018 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29959 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 29959-submit@debbugs.gnu.org id=B29959.15163025021949 (code B ref 29959); Thu, 18 Jan 2018 19:09:01 +0000 Original-Received: (at 29959) by debbugs.gnu.org; 18 Jan 2018 19:08:22 +0000 Original-Received: from localhost ([127.0.0.1]:33679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecFXy-0000VM-HG for submit@debbugs.gnu.org; Thu, 18 Jan 2018 14:08:22 -0500 Original-Received: from forward104o.mail.yandex.net ([37.140.190.179]:36082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecFXt-0000V4-EM for 29959@debbugs.gnu.org; Thu, 18 Jan 2018 14:08:18 -0500 Original-Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward104o.mail.yandex.net (Yandex) with ESMTP id DE350701C5E; Thu, 18 Jan 2018 22:08:10 +0300 (MSK) Original-Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VAupExEkSY-8AXSJAeO; Thu, 18 Jan 2018 22:08:10 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1516302490; bh=oqX+1svKFLZ9Jni2C6FqKeljf1VayGCjEb6smHjr8ys=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=R5PC6u8JQTr6kRFJX2KJYO/ZFmFhmwj2MrmJ0SsepqWq3sDWJL/KI8kOKI8Vt2iNA cBJnTViqAgZcYujwUHvYXMmZZp/iOFjv8jBw2qK0FiTNb6u2S7b5yLUObFNBXk+aO7 4cROtycgYf4lCybBRGJNYiRZ/Ij66g1NuCCBpczM= Original-Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tmtEaBZJpl-89V8emdi; Thu, 18 Jan 2018 22:08:09 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1516302490; bh=oqX+1svKFLZ9Jni2C6FqKeljf1VayGCjEb6smHjr8ys=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=R5PC6u8JQTr6kRFJX2KJYO/ZFmFhmwj2MrmJ0SsepqWq3sDWJL/KI8kOKI8Vt2iNA cBJnTViqAgZcYujwUHvYXMmZZp/iOFjv8jBw2qK0FiTNb6u2S7b5yLUObFNBXk+aO7 4cROtycgYf4lCybBRGJNYiRZ/Ij66g1NuCCBpczM= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <20180118184137.GB21934@ACM> Content-Language: ru-RU X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142266 Archived-At: Cool, thanks, I applied it locally, works for me! On 18.01.2018 21:41, Alan Mackenzie wrote: > Hello again, Konstantin. > > On Sat, Jan 13, 2018 at 20:37:52 +0000, Alan Mackenzie wrote: >> On Sat, Jan 13, 2018 at 14:11:31 +0300, Konstantin Kharlamov wrote: >>> Just tested with current git, the problem is still present. > >>> I am almost sure this is a regression, I don't remember having that >>> problem before. The real-world consequences are just too annoying for it >>> to go unnoticed — basically, every time I'm typing variables indentation >>> just doesn't work. And I also seem to remember a few irrelevant >>> situations where I was typing conditions with the like results. > >> The problem originates in a new feature, C99 compound literals, which was >> committed on 2017-11-10. This detects brace blocks (meaning something >> like the initialisation of a struct) in the middle of executable code, >> but it is clear the test for such a brace block isn't rigorous enough, >> since even function blocks are being mistaken for them. > > The new feature, C99 compound literals, has been removed from the > emacs-26 branch, so as to avoid delaying the relase process for that > branch. The commit has hash 36edb6cb97ce3d53543c87643077d270bb5bdfd1, > and it should apply without problems to the master branch. > > It is to be hoped that a more elaborate and more correct solution will > be found soon for the master branch. > >>> On 03.01.2018 09:02, Konstantin Kharlamov wrote: >>>> # Steps to reproduce: >>>> 1. Open emacs -Q test.c >>>> 2. Write the following: > >>>> int main() { >>>>     int a, >>>> } > >>>> 3. put the caret after the comma symbol, and press enter, e.g. to >>>> continue writing variables on the new line. > >>>> # Expected: >>>> the new line alignment stands out with regard to the prev. line. > >>>> # Actual: >>>> the new line aligned to the beginning of the prev. line. > >>>> # Workarounds: >>>> Typing the following text: > >>>> int main() { >>>>     int a,; >>>> } > >>>> …then pressing enter right after the comma works as expected. > >>>> ------------ > >>>> In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26) >>>>  of 2017-12-15 built on constantine-N61Ja >>>> Repository revision: 6c301afa70f6eac32ad1ce92412ea3cf6fcdeeca >>>> Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 >>>> System Description: Arch Linux > >> [ .... ] >