From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rolf Ade Newsgroups: gmane.emacs.bugs Subject: bug#23775: 25.0.95.2; c-mode: Incorrect indentation and function bundery detection Date: Thu, 16 Jun 2016 03:05:43 +0200 Message-ID: <8760tac594.fsf@linux-qg7d.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466039252 15705 80.91.229.3 (16 Jun 2016 01:07:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jun 2016 01:07:32 +0000 (UTC) To: 23775@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 16 03:07: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 1bDLmA-0008Fm-Tg for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 03:07:19 +0200 Original-Received: from localhost ([::1]:45863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDLm6-0000MD-Sl for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Jun 2016 21:07:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDLly-0000Jk-Tk for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:07:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDLlu-0003va-MD for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:07:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDLlu-0003vW-IJ for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bDLlu-0007OQ-EP for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rolf Ade Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2016 01:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23775 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.146603918028368 (code B ref -1); Thu, 16 Jun 2016 01:07:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jun 2016 01:06:20 +0000 Original-Received: from localhost ([127.0.0.1]:42719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDLlD-0007NU-W5 for submit@debbugs.gnu.org; Wed, 15 Jun 2016 21:06:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDLlC-0007NI-Ej for submit@debbugs.gnu.org; Wed, 15 Jun 2016 21:06:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDLl6-0003px-JG for submit@debbugs.gnu.org; Wed, 15 Jun 2016 21:06:13 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDLl6-0003pl-GF for submit@debbugs.gnu.org; Wed, 15 Jun 2016 21:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDLl4-0008Jx-Bx for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:06:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDLl0-0003pK-1D for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:06:09 -0400 Original-Received: from mxout3.interscholz.de ([85.236.196.238]:33519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDLkz-0003op-R8 for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 21:06:05 -0400 Original-Received: from localhost (mxout3 [127.0.0.1]) by mxout3.interscholz.de (Postfix) with ESMTP id D6F12216BF for ; Thu, 16 Jun 2016 03:06:01 +0200 (CEST) X-Virus-Scanned: interscholz amavisd-new at mxout3.interscholz.de Original-Received: from server.web01.interscholz.net (server.web01.interscholz.net [85.236.196.138]) by mxout3.interscholz.de (Postfix) with ESMTP id 8708A208F3 for ; Thu, 16 Jun 2016 03:05:45 +0200 (CEST) Original-Received: from linux-qg7d.fritz.box (p4FFBE0F0.dip0.t-ipconnect.de [79.251.224.240]) by server.web01.interscholz.net (Postfix) with ESMTPSA id DD4E0340362; Thu, 16 Jun 2016 03:05:43 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:119608 Archived-At: emacs -Q Open some empty buffer foo.c and put it into c-mode if already is (M-x c-mdoe). Insert this C code into it: #define foo int main (void) { int a=0; int b=0; #ifdef foo if (a==0) { #else if (b==0) { #endif return 0; } } I've inserted it here as emacs -Q indents it, this is the indentation part of the report. Place the point at the beginning of function foo, then call c-end-of-defun, C-M-e by default in emacs -Q. Bell rings, point is before the last charater of the first line of main, here: int main (void) _P_{ (which is clearly not the end of the function) and prompts me in the mini-buffer: "forward-sexp: Scan error: "Unbalanced parentheses", 29, 133" However well advised such code is, gcc foo.c just compilies.