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 21:56:30 +0700 Message-ID: <544D0B9E.3090606@yandex.ru> References: <86egtwgra0.fsf@yandex.ru> 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 1414335457 19022 80.91.229.3 (26 Oct 2014 14:57:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2014 14:57:37 +0000 (UTC) Cc: 18826@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 26 15:57:30 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 1XiPG5-0005n5-C0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Oct 2014 15:57:29 +0100 Original-Received: from localhost ([::1]:56911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiPG4-00062H-Oi for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Oct 2014 10:57:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiPFu-00061z-V7 for bug-gnu-emacs@gnu.org; Sun, 26 Oct 2014 10:57:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiPFn-0007uX-7Y for bug-gnu-emacs@gnu.org; Sun, 26 Oct 2014 10:57:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiPFf-0007dm-6L; Sun, 26 Oct 2014 10:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XiPFe-0004Qm-E8; Sun, 26 Oct 2014 10:57: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: Sun, 26 Oct 2014 14:57: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.141433540616998 (code B ref 18826); Sun, 26 Oct 2014 14:57:02 +0000 Original-Received: (at 18826) by debbugs.gnu.org; 26 Oct 2014 14:56:46 +0000 Original-Received: from localhost ([127.0.0.1]:36067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XiPFN-0004Q6-CI for submit@debbugs.gnu.org; Sun, 26 Oct 2014 10:56:45 -0400 Original-Received: from mail-pa0-f41.google.com ([209.85.220.41]:51451) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XiPFI-0004Po-LQ for 18826@debbugs.gnu.org; Sun, 26 Oct 2014 10:56:42 -0400 Original-Received: by mail-pa0-f41.google.com with SMTP id rd3so3904326pab.0 for <18826@debbugs.gnu.org>; Sun, 26 Oct 2014 07:56:34 -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=OEHF1rliSGOZ/Li0lwEulPB8VO5m2yMojjlQD/975LY=; b=VZVIVcUoiJU6ye5suBEka7oP874V3IRsCwpnsh8ddrMJ4/uxAUrMwhod22YvXci/o1 h0fNTwJpurwgSkJhusYO0oPOkAZzJpkrvv0N885aENDUu3YwqJ1G4FrEtzxfdGQTIDu+ AUKoyf0KbIfz8hFa3BJmAR9ySQAt+QWL/nqVqiUwauqMpIZ3yBkTptZeeqEEn/anmo7/ mC7LnEublNr7gJQ8PTpVNM1Vqf9Pmgmc9YhsdrQiM7kyQXVGYXumrTOzN+CFM9htbRK3 GCrTOvPhHMYwBUu+KCZpanS9k1Ux/QMiTxgPSpN1Z0L7zyqazE0ilhKoVgI3oPA+O1bC 60ow== X-Received: by 10.69.13.196 with SMTP id fa4mr5697972pbd.65.1414335394145; Sun, 26 Oct 2014 07:56:34 -0700 (PDT) Original-Received: from [192.168.2.52] ([113.160.248.69]) by mx.google.com with ESMTPSA id yw3sm8500350pbc.88.2014.10.26.07.56.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 07:56:33 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: 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:95101 On 10/26/2014 06:25 AM, Stefan Monnier wrote: >> (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)")) > > Why do that? To include angle brackets in paren syntax class. Basically, we only need to consider these and the straight parens when converting a method definition into a method call with placeholders, so using an otherwise-empty syntax table seemed appropriate when I wrote the above code. It seems that I should only change the current syntax table only around the `backward-sexp' and `parse-partial-sexp' calls there, but not when doing any text modification.