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: Sun, 26 Oct 2014 05:45:42 +0700 Message-ID: <544C2816.8070704@yandex.ru> References: <20141025193441.10278.qmail@mail.muc.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1414277192 21229 80.91.229.3 (25 Oct 2014 22:46:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2014 22:46:32 +0000 (UTC) Cc: 18826@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 26 00:46:26 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 1XiA6K-0000nZ-Su for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Oct 2014 00:46:25 +0200 Original-Received: from localhost ([::1]:54803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiA6K-0004O4-FM for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2014 18:46:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiA6B-0004Nr-Ni for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 18:46:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiA65-0001CM-R9 for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2014 18:46:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiA5z-00016M-As; Sat, 25 Oct 2014 18:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XiA5y-0004tJ-K9; Sat, 25 Oct 2014 18:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 25 Oct 2014 22:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18826 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 18826-submit@debbugs.gnu.org id=B18826.141427715618787 (code B ref 18826); Sat, 25 Oct 2014 22:46:02 +0000 Original-Received: (at 18826) by debbugs.gnu.org; 25 Oct 2014 22:45:56 +0000 Original-Received: from localhost ([127.0.0.1]:35541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XiA5r-0004sw-QI for submit@debbugs.gnu.org; Sat, 25 Oct 2014 18:45:56 -0400 Original-Received: from mail-pd0-f174.google.com ([209.85.192.174]:52380) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XiA5o-0004sd-MU for 18826@debbugs.gnu.org; Sat, 25 Oct 2014 18:45:53 -0400 Original-Received: by mail-pd0-f174.google.com with SMTP id p10so3374229pdj.5 for <18826@debbugs.gnu.org>; Sat, 25 Oct 2014 15:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7WI1I+PQofobyMM1E2BsF6p9cXSXnxRgLzKha/+8FAU=; b=JtSxjea771Nlu7+oCXtirCcaJuRA1j7XerOt5KhJPERRmVPoMa7DaojdSQjv7vwp7I 0sTHlSfWZxHtrBIEXmH4o3BafDuV6Ja0fbeCD2vDPdRZ/oLK6kmNn6xcDkTGE/Zftb0r LtpfomWyYV+ilTP6gDwnCu6xOlvahyu1TA62sjsANx+WsFXYkhlJ/gEYCFgKIXQNiJhz OFJrkXtj3fJKiOKyrBnnC9lPyqJ6gzgf6Tm2xf1AVH0ct3W9fxGb/2yA45mhV2OjBgUN nykhW5NQEDjx3fVdifijaHwtYxMlz3GVxhD20czi6GyvSlsVdhSX73Pemp3XjVLhfbCz pOQw== X-Received: by 10.68.251.99 with SMTP id zj3mr13592540pbc.105.1414277146416; Sat, 25 Oct 2014 15:45:46 -0700 (PDT) Original-Received: from [192.168.2.52] ([113.160.248.69]) by mx.google.com with ESMTPSA id ib8sm7074927pad.43.2014.10.25.15.45.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 15:45:45 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <20141025193441.10278.qmail@mail.muc.de> 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:95085 On 10/26/2014 02:34 AM, Alan Mackenzie wrote: > Why do you think it should be harmless? Because the syntax table change is temporary and its effect should be limited to my code? > . The c-in-sws and c-is-sws indicate that the semicolon has been > recognised and marked as syntactic whitespace. The second line thus gets > parsed as "statement-cont", i.e. a continued statement, so it gets > indented an extra level. Yes, I see that. But how does this happen? > If you cripple C++ Mode by substituting a wrong syntax table, you > shouldn't be too surprised when things go "wrong". This seems like one of > these "well, don't do that, then" bugs. > > Question: why do you want to play around with the syntax table in this > manner? What are you trying to achieve? I'm using a different syntax table for sexp movement, where it's necessary for both parens and angle brackets to have paren syntax class. In the actual code I modify the text after it's inserted, and `backward-sexp' is used two times to find necessary search bounds. https://github.com/company-mode/company-mode/blob/42012730da15ffaef7c61722475040babed15332/company-template.el#L155-L173