bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16346: 24.3; electric-pair-mode close-paren issue


From: Leo Liu
Subject: bug#16346: 24.3; electric-pair-mode close-paren issue
Date: Sun, 05 Jan 2014 23:30:47 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.9.1)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]