From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simon Law Newsgroups: gmane.emacs.bugs Subject: bug#11530: 24.1.50; electric-pair does not insert closer for double opener Date: Sun, 20 May 2012 23:59:13 -0400 Message-ID: <87sjeup4ku.fsf@sfllaw.ca> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1337572845 17840 80.91.229.3 (21 May 2012 04:00:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 May 2012 04:00:45 +0000 (UTC) To: 11530@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 21 06:00:43 2012 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 1SWJnT-0008V4-8L for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 May 2012 06:00:39 +0200 Original-Received: from localhost ([::1]:38439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJnS-0000SR-QN for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 May 2012 00:00:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJnJ-0000SJ-VK for bug-gnu-emacs@gnu.org; Mon, 21 May 2012 00:00:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWJnH-0000VZ-V1 for bug-gnu-emacs@gnu.org; Mon, 21 May 2012 00:00:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJnH-0000VU-Rq for bug-gnu-emacs@gnu.org; Mon, 21 May 2012 00:00:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SWJnq-00010c-G6 for bug-gnu-emacs@gnu.org; Mon, 21 May 2012 00:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simon Law Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 May 2012 04:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11530 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.13375728293834 (code B ref -1); Mon, 21 May 2012 04:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 May 2012 04:00:29 +0000 Original-Received: from localhost ([127.0.0.1]:36051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWJnI-0000zn-OB for submit@debbugs.gnu.org; Mon, 21 May 2012 00:00:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37950) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWJmy-0000yu-Bd for submit@debbugs.gnu.org; Mon, 21 May 2012 00:00:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWJmI-0000HK-2I for submit@debbugs.gnu.org; Sun, 20 May 2012 23:59:27 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:48013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJmH-0000HF-VN for submit@debbugs.gnu.org; Sun, 20 May 2012 23:59:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJmF-0000NM-Pq for bug-gnu-emacs@gnu.org; Sun, 20 May 2012 23:59:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWJmD-0000Gf-5V for bug-gnu-emacs@gnu.org; Sun, 20 May 2012 23:59:23 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:51813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWJmC-0000GP-Uh for bug-gnu-emacs@gnu.org; Sun, 20 May 2012 23:59:21 -0400 Original-Received: by obbwd18 with SMTP id wd18so9582010obb.0 for ; Sun, 20 May 2012 20:59:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :x-gm-message-state; bh=ONwVMUR2u+HSsq5pW0ti4sXnmB8iOIHlvHDz2CQzhFg=; b=Gg4ikR4mBk/b70qswE/OEaL4Xjw4PyIGzG8NkaxJmOFONqYsI7ipeuMO0KC+tX7Zn/ jcBRQ6jIBuIhWwH7ieq+avpjnU56LUnAT84OOdaee/JYs0OFfEH4EP5pb03JuArlvSMR tAMAxf+E5GMUziUGbomb/zBIweMkIcH7refFamYd0sChgkR8gWVuszfp64q+ocUgYtQ3 jEpZrQNrv7Q8d9GvPlppqKW2M1/1xWzRkw5tqo6zhA3s0VEbf7pzneWoeamscPcFQIv+ MrzhBPdFhXGhj24KnE3r+Z8R3UbFNaeakkNClQILe/er0crQh0KkufzYuAvgFgTiok5W KBSw== Original-Received: by 10.50.89.166 with SMTP id bp6mr5600821igb.69.1337572757335; Sun, 20 May 2012 20:59:17 -0700 (PDT) Original-Received: from boson (76-10-168-90.dsl.teksavvy.com. [76.10.168.90]) by mx.google.com with ESMTPS id xf6sm11647376igb.13.2012.05.20.20.59.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 20 May 2012 20:59:16 -0700 (PDT) X-Gm-Message-State: ALoCoQlVzwtsdwvXNLt/eP3rksQuYgCzE/20C/lyexFnnHqRK7uPkECZw3niqWm6qTyOXAQqfrwW X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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 (newer, 2) 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:60252 Archived-At: Reproduction steps: $ emacs -Q M-x electric-pair-mode Type "((" Expected result, where | is the point: ((|)) Actual result: ((|) Notes: Users expect typing two-openers will result in two matching closers, due to the description of electric-pair-mode. It looks like the bug is caused in electric-pair-post-self-insert-function on line 354. Here is a patch: diff -c -L /usr/share/emacs/24.1.50/lisp/electric.el.gz -L \#\ /tmp/jka-com15573B0q /tmp/buffer-content-15573AIA *** /usr/share/emacs/24.1.50/lisp/electric.el.gz --- # *************** *** 351,357 **** ;; 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)))) ;; I also find it often preferable not to pair next to a word. (eq (char-syntax (following-char)) ?w))) (save-excursion (insert closer)))))) --- 351,356 ---- The comment above the deleted line is actually valid, but the deleted line does not reflect that comment at all. In GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.2.0) of 2012-05-10 on charichuelo, modified by Debian (emacs-snapshot package, version 2:20120510-1~ppa1~oneiric1) Windowing system distributor `The X.Org Foundation', version 11.0.11004000 Configured using: `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.1.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1.50/site-lisp:/usr/share/emacs/site-lisp' '--without-compress-info' '--with-crt-dir=/usr/lib/x86_64-linux-gnu/' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed -znocombreloc' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: en_CA.UTF-8 value of $LC_CTYPE: en_CA.UTF-8 value of $LC_MESSAGES: en_CA.UTF-8 value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_CA.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: electric-pair-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x e l e c t r i c - p a i ( ( C-a C-SPC C-n M-w C-x b C-g C-x 4 m C-x k C-x o ( ( M-x r e p o r t - b e b u g - e m e m Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Electric-Pair mode enabled Mark set byte-code: End of buffer Quit Load-path shadows: /usr/share/emacs/24.1.50/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup Features: (shadow sort mail-extr emacsbug sendmail gnus-util message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader cus-start cus-load electric time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)