From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Bormann Newsgroups: gmane.emacs.bugs Subject: bug#14000: 24.3.50; electric-pair-post-self-insert-function does not handle nested parentheses Date: Tue, 19 Mar 2013 18:59:53 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363722879 4045 80.91.229.3 (19 Mar 2013 19:54:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Mar 2013 19:54:39 +0000 (UTC) To: 14000@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 19 20:55:02 2013 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 1UI2cc-0007vO-AL for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2013 20:54:58 +0100 Original-Received: from localhost ([::1]:48485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI2cF-0002n0-6T for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2013 15:54:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI2c5-0002ju-IW for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 15:54:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI2c2-0003RU-6x for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 15:54:25 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI2c2-0003QY-4G for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 15:54:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UI2de-0006y8-Iw for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 15:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Carsten Bormann Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Mar 2013 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14000 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.136372293226745 (code B ref -1); Tue, 19 Mar 2013 19:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Mar 2013 19:55:32 +0000 Original-Received: from localhost ([127.0.0.1]:36063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UI2d9-0006xJ-LZ for submit@debbugs.gnu.org; Tue, 19 Mar 2013 15:55:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53940) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UI2d7-0006x8-CX for submit@debbugs.gnu.org; Tue, 19 Mar 2013 15:55:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI2bR-0002sg-LM for submit@debbugs.gnu.org; Tue, 19 Mar 2013 15:53:48 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:58040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI2bR-0002sW-GY for submit@debbugs.gnu.org; Tue, 19 Mar 2013 15:53:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI2bN-0002c3-Ng for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 15:53:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI0pb-0006pg-U5 for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 14:00:22 -0400 Original-Received: from mailhost.informatik.uni-bremen.de ([2001:638:708:30c9::12]:51414 helo=informatik.uni-bremen.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI0pb-0006oD-HD for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 14:00:15 -0400 X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de Original-Received: from alma.local.informatik.uni-bremen.de (maildrop.informatik.uni-bremen.de [134.102.201.19]) by informatik.uni-bremen.de (8.14.4/8.14.4) with ESMTP id r2JI01C2025406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 19 Mar 2013 19:00:06 +0100 (CET) X-Mailer: emacs 24.3.50.1 (via feedmail 11-beta-1 I) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:72718 Archived-At: In electric-pair-mode, I type "((" I get "(()" I should get "(())" Fix below. In GNU Emacs 24.3.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-19 on bob.porkrind.org Bzr revision: 112090 dgutov@yandex.ru-20130319050649-jie5ixrjvsavih4i Windowing system distributor `Apple', version 10.3.1187 Configured using: `configure --host=x86_64-apple-darwin --build=i686-apple-darwin --with-ns' --- electric.el 2013-03-19 18:51:05.000000000 +0100 +++ electric-fixed.el 2013-03-19 18:55:59.000000000 +0100 @@ -354,7 +354,10 @@ ;; I find it more often preferable not to pair when the ;; same char is next. (eq last-command-event (char-after)) - (eq last-command-event (char-before (1- (point)))) + (and + (eq last-command-event (char-before (1- (point)))) + (not (eq syntax ?\()) + ) ;; I also find it often preferable not to pair next to a word. (eq (char-syntax (following-char)) ?w))) (save-excursion (insert closer))))))