unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Carsten Bormann <cabo@tzi.org>
To: 14000@debbugs.gnu.org
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	[thread overview]
Message-ID: <m2fvzrjmna.fsf@tzi.org> (raw)

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))))))





             reply	other threads:[~2013-03-19 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 17:59 Carsten Bormann [this message]
2013-03-26  2:41 ` bug#14000: 24.3.50; electric-pair-post-self-insert-function does not handle nested parentheses Stefan Monnier
2013-03-26  7:27   ` Carsten Bormann
2013-03-26 13:18     ` bug#14000: 24.3.50; electric-pair-post-self-insert-function does not handle nestedparentheses Drew Adams
2013-03-26 13:32       ` Carsten Bormann
2013-03-26 14:20         ` Drew Adams
2013-03-26 16:48     ` bug#14000: 24.3.50; electric-pair-post-self-insert-function does not handle nested parentheses Stefan Monnier
2013-04-01 13:28     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fvzrjmna.fsf@tzi.org \
    --to=cabo@tzi.org \
    --cc=14000@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).