From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#29959: cc-mode: wrong indentation in absence of semicolon Date: Thu, 18 Jan 2018 18:41:37 +0000 Message-ID: <20180118184137.GB21934__38950.1109523282$1516301319$gmane$org@ACM> References: <8a042ba1-301c-8943-1381-537cba8a2334@yandex.ru> <20180113203752.GA9688@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1516301319 6238 195.159.176.226 (18 Jan 2018 18:48:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 18:48:39 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 29959@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 19:48:34 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 1ecFEg-0000yH-Us for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 19:48:27 +0100 Original-Received: from localhost ([::1]:47550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecFGh-0005w3-3n for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 13:50:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecFFN-0004qn-EU for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 13:49:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecFFM-00075R-Ce for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2018 13:49:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54003) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecFFG-00071R-VJ; Thu, 18 Jan 2018 13:49:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ecFFG-0008UV-8w; Thu, 18 Jan 2018 13:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 18 Jan 2018 18:49:02 +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.151630129532584 (code B ref 29959); Thu, 18 Jan 2018 18:49:02 +0000 Original-Received: (at 29959) by debbugs.gnu.org; 18 Jan 2018 18:48:15 +0000 Original-Received: from localhost ([127.0.0.1]:33667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecFEV-0008TU-26 for submit@debbugs.gnu.org; Thu, 18 Jan 2018 13:48:15 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:35413 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ecFES-0008TK-LY for 29959@debbugs.gnu.org; Thu, 18 Jan 2018 13:48:13 -0500 Original-Received: (qmail 96496 invoked by uid 3782); 18 Jan 2018 18:48:11 -0000 Original-Received: from acm.muc.de (p548C76DC.dip0.t-ipconnect.de [84.140.118.220]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 18 Jan 2018 19:48:10 +0100 Original-Received: (qmail 22050 invoked by uid 1000); 18 Jan 2018 18:41:37 -0000 Content-Disposition: inline In-Reply-To: <20180113203752.GA9688@ACM> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:142263 Archived-At: 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 > [ .... ] -- Alan Mackenzie (Nuremberg, Germany).