From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#18826: 24.3.94; c++-mode bad indentation after programmatic insert with locally changed syntax table Date: Sat, 25 Oct 2014 21:25:43 +0700 Message-ID: <86egtwgra0.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414247244 1572 80.91.229.3 (25 Oct 2014 14:27:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2014 14:27:24 +0000 (UTC) To: 18826@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 25 16:27:19 2014 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 1Xi2JK-0005BJ-Uw for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2014 16:27:19 +0200 Original-Received: from localhost ([::1]:53643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi2JK-0003mD-F0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2014 10:27:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi2JC-0003m0-W9 for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:27:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xi2J5-0007MU-5e for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:27:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi2J5-0007Ly-2B for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xi2J4-0001Mo-J4 for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Oct 2014 14:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18826 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.14142471725195 (code B ref -1); Sat, 25 Oct 2014 14:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Oct 2014 14:26:12 +0000 Original-Received: from localhost ([127.0.0.1]:35374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xi2IG-0001Lj-AM for submit@debbugs.gnu.org; Sat, 25 Oct 2014 10:26:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45901) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xi2ID-0001LQ-Rd for submit@debbugs.gnu.org; Sat, 25 Oct 2014 10:26:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xi2I3-0007Dn-Mi for submit@debbugs.gnu.org; Sat, 25 Oct 2014 10:26:04 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi2I3-0007Dj-K0 for submit@debbugs.gnu.org; Sat, 25 Oct 2014 10:25:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi2Hy-0003hW-KW for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:25:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xi2Ht-0007Cl-Sd for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:25:54 -0400 Original-Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]:59885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi2Ht-0007CV-Kj for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 10:25:49 -0400 Original-Received: by mail-pd0-f180.google.com with SMTP id ft15so1081627pdb.39 for ; Sat, 25 Oct 2014 07:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=b6+jzlMr7BQB3iKRBBRHwvWAKsCjUD93xIYXWfV60Ds=; b=v1Prwe4/jHWOuCuWVQpdikD6lKO5HvpQORRULS1EoZxpMgXueHskrr2LYKiAqEMZ9l Jfj2KK47R7UdGs3Bi3P+5bhUIy195cP8sAsMPt9lTZYxaLnkeKG+WN4gRI8zcXPeLQkf s1PXaQ2fTIRWkYe50Qu5vRW+Wm+0Z1Ug1pmfvvPj9nCi1LyTukLrqADHUP7qmkl2Mn9o 7m5F4rYRBkfnNdF71lcLIh5gDPpwnIMjo8yezw4NAYrsSnbviefzPV+QlZ4oY/svYr3H NSDKZFfQzsV2DIPV64Xcc60whrB/krzWdpsI2yjVmySuSxXvTQCOwaayMQPNnok+hiVt A/Yw== X-Received: by 10.67.5.41 with SMTP id cj9mr11330968pad.73.1414247147671; Sat, 25 Oct 2014 07:25:47 -0700 (PDT) Original-Received: from axl ([113.160.248.69]) by mx.google.com with ESMTPSA id sa6sm6373031pbb.29.2014.10.25.07.25.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 25 Oct 2014 07:25:47 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95071 I think the following should be harmless. Why does it result in broken indentation? 1. Open in c++-mode buffer with following contents: int main(int argc, char** argv) { fgets(0, 1, 2); } 2. Add an empty line after the semicolon, move cursor there, and evaluate this: (with-syntax-table (make-char-table 'syntax-table nil) (modify-syntax-entry ?\( "(") (modify-syntax-entry ?\) ")") (modify-syntax-entry ?< "(") (modify-syntax-entry ?> ")") (insert "fgets(0, 1, 2)")) 3. Press `;', see the indentation of the current line change, and include (erroneously) two extra spaces: int main(int argc, char** argv) { fgets(0, 1, 2); fgets(0, 1, 2); } Originally: https://github.com/company-mode/company-mode/issues/212 In GNU Emacs 24.3.94.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-10-06 on axl Repository revision: 117555 sdl.web@gmail.com-20141005005838-oyl694hqhu2d3632 Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS