From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Newsgroups: gmane.emacs.bugs Subject: bug#16346: 24.3; electric-pair-mode close-paren issue Date: Sun, 05 Jan 2014 11:49:34 +0000 Message-ID: <878uuuy7g1.fsf@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388922735 23280 80.91.229.3 (5 Jan 2014 11:52:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jan 2014 11:52:15 +0000 (UTC) Cc: 16346@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 05 12:52:21 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 1VzmFg-0003Rd-9Y for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Jan 2014 12:52:20 +0100 Original-Received: from localhost ([::1]:57549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzmFf-0000AD-V8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Jan 2014 06:52:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzmFW-00009s-9N for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 06:52:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzmFO-0002la-VM for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 06:52:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzmFO-0002lW-RX for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 06:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VzmFO-0000Lj-Hk for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 06:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2014 11:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16346 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16346-submit@debbugs.gnu.org id=B16346.13889226961246 (code B ref 16346); Sun, 05 Jan 2014 11:52:02 +0000 Original-Received: (at 16346) by debbugs.gnu.org; 5 Jan 2014 11:51:36 +0000 Original-Received: from localhost ([127.0.0.1]:35385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzmEx-0000K1-Ow for submit@debbugs.gnu.org; Sun, 05 Jan 2014 06:51:36 -0500 Original-Received: from mail-we0-f180.google.com ([74.125.82.180]:64175) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzmEv-0000Jk-3s for 16346@debbugs.gnu.org; Sun, 05 Jan 2014 06:51:33 -0500 Original-Received: by mail-we0-f180.google.com with SMTP id t61so14803875wes.39 for <16346@debbugs.gnu.org>; Sun, 05 Jan 2014 03:51:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=LBfnWJVr4djL9hXJy8pMQIo5VoPH8VNNlssI7YAMme8=; b=baLFfGUgNNvHuhDJtKmXu1OeCOp/hvs8i46OzoP5MNESlwaAB7KtdnIQ1cw6ahEZRE 0hcTg2K5wWj9vpQbs3Ap+un1QRKEDxiDjw8Q6ubO5nTGZxEST3nNatLF9Ta560M8jxqo LMMmCSS8zWnmPG5JWFmTbF5SUSc25E3O1Ip6P2hqmgodqtHsNcVa7g6B1rIAJVp4woCF pI8d8YObseDiKmRTGgLqp5ndbcp7LvkWWzKcuCnosEg/GdMUszrT9hAdLhuvoKFYiYmv F0rR+KvClv+Yb5bVbkqnJvXOztanqUrOG3eyK9vtsSumqPp/fWbLYKtUZ5d4B6ejReVg Uc8g== X-Received: by 10.180.13.139 with SMTP id h11mr8528925wic.3.1388922692049; Sun, 05 Jan 2014 03:51:32 -0800 (PST) Original-Received: from kitaj.yourcompany.com (66.207.108.93.rev.vodafone.pt. [93.108.207.66]) by mx.google.com with ESMTPSA id kr10sm39890123wjc.22.2014.01.05.03.51.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 05 Jan 2014 03:51:31 -0800 (PST) In-Reply-To: (Leo Liu's message of "Sun, 05 Jan 2014 10:57:02 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:82997 Archived-At: Leo Liu writes: > In some of the eldoc-documentation-function's when used by > eldoc-post-insert-mode, for example octave-eldoc-function, the eldoc > (calltip) is only shown after inserting the ( and inside the (). > > The new feature introduced to electric-pair-mode fails the above by > triggering two successive runs of post-self-insert-hook, one for > inserting the open-paren and the other for the close-paren. Thus the > eldoc message is immediately cleared by the second run. Are you sure this is only with the new features? > My impression is if a user didn't type ) it should not trigger > post-self-insert-hook. WDYT? The idea of inserting matchers with self-insert-command is to allow other hooks to run recursively, but it has some problems as described by the FIXME's that I found before my changes electric-pair-mode. Indeed, it wasn't "self inserted" it, it was "electric inserted". electric-pair--insert is this abstraction and it's used to insert matchers. It does some rebinding of vars to keep other modes like blink-matching-paren from interfering. Maybe eldoc-mode deserves a place in there? (defun electric-pair--insert (char) (let ((last-command-event char) (blink-matching-paren nil) (electric-pair-mode nil) (eldoc-mode nil)) (self-insert-command 1))) Haven't tested though... Will have little time the coming weeks, sorry.