From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#24022: 24.5; C indentation failure Date: 21 Jul 2016 19:31:18 -0000 Organization: muc.de e.V. Message-ID: <20160721193118.21930.qmail@mail.muc.de> References: <8737n8rs1l.fsf@saturn.csh.rit.edu> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1469129549 23058 80.91.229.3 (21 Jul 2016 19:32:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2016 19:32:29 +0000 (UTC) Cc: 24022@debbugs.gnu.org To: robgssp@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 21 21:32:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQJhi-0008TN-QI for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jul 2016 21:32:18 +0200 Original-Received: from localhost ([::1]:43232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJhi-00051a-3l for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jul 2016 15:32:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJha-0004zp-Aa for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 15:32:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQJhY-0007cD-A6 for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 15:32:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJhS-0007bc-6M; Thu, 21 Jul 2016 15:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQJhS-0007OP-0B; Thu, 21 Jul 2016 15:32:02 -0400 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, 21 Jul 2016 19:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24022 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 24022-submit@debbugs.gnu.org id=B24022.146912948328370 (code B ref 24022); Thu, 21 Jul 2016 19:32:01 +0000 Original-Received: (at 24022) by debbugs.gnu.org; 21 Jul 2016 19:31:23 +0000 Original-Received: from localhost ([127.0.0.1]:60623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQJgp-0007NW-GL for submit@debbugs.gnu.org; Thu, 21 Jul 2016 15:31:23 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:55626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQJgn-0007NJ-FG for 24022@debbugs.gnu.org; Thu, 21 Jul 2016 15:31:22 -0400 Original-Received: (qmail 21931 invoked by uid 3782); 21 Jul 2016 19:31:18 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.3-RELEASE-p4 (amd64)) 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:121394 Archived-At: Hello, robgssp. In article you wrote: > c-mode fails to indent correctly when a #if is followed by a > comment. Example: > int main() { > #if defined(a) // comment > if (b) { > body(); > } > #endif > } > Clearly this isn't the correct indentation. A clean run under -Q behaves > the same way. Yes. Thanks for taking the trouble to report this problem, and thanks even more for cutting the source down to a small, easy to handle test case. There have been extensive changes to CC Mode since the release of Emacs 24.5, and the problem isn't apparent in more recent versions. Bisecting the changes in mercurial suggest that this bug was "solved" by a commit on 2016-05-29. I've tried to adapt this commit so that it will apply to the Emacs 24.5 sources, but the changes are just too many for this to be practicable. Would it be OK for me to send you a tarball of the up-to-date CC Mode sources (~1.34 Mb) so that you could build these on Emacs 24.5 and check that the error really has been fixed (and not just in the cut down test case you've sent me)? > In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.6) > of 2016-06-04 on juergen > Windowing system distributor `The X.Org Foundation', version 11.0.11803000 > System Description: Arch Linux > Configured using: > `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib > --localstatedir=/var --with-x-toolkit=gtk3 --with-xft > 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe > -fstack-protector-strong' CPPFLAGS=-D_FORTIFY_SOURCE=2 > LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' > Important settings: > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > Major mode: C/l -- Alan Mackenzie (Nuremberg, Germany).