GNU bug report logs - #16346
24.3; electric-pair-mode close-paren issue

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Sun, 5 Jan 2014 02:58:02 UTC

Severity: normal

Found in version 24.3

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 16346 <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: joaotavora <at> gmail.com (João Távora)
Cc: 16346 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#16346: 24.3; electric-pair-mode close-paren issue
Date: Sun, 05 Jan 2014 23:30:47 +0800
On 2014-01-05 19:49 +0800, João Távora wrote:
> Are you sure this is only with the new features?

Yes.

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

But this may break the other half of stuff using post-self-insert-hook?

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

Add (eldoc-post-insert-mode nil) fixes this bug.

Leo




This bug report was last modified 11 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.