[Top][All Lists]

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

Re: [patch] make electric-pair-mode smarter/more useful

From: Stefan Monnier
Subject: Re: [patch] make electric-pair-mode smarter/more useful
Date: Sat, 07 Dec 2013 18:16:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> Autobackspacing two adjacent parens sounds good.
> How should one approach this in electric.el? Should a hook be added to
> `backward-delete-char-untabify`? Should this be included in the
> `electric-layout-mode' somehow?

We could remap backward-delete-char-untabify in electric-pair-mode-map.

>> I'm also partial to the `autopair-newline' feature. It would probably
>> serve best as an extension of `electric-layout-mode'.
> Yes, I agree that `electric-layout-mode' seems the place for this, but
> how to write these rules in the existing `electric-layout-rules' var?

Indeed, it doesn't really fit in there.  You could probably hack it in
brute-force style by adding the newline directly from
electric-layout-in-between-parenthesis (and then return nil rather than

> - both openers and closers should cause a wrap (currently only
>   openers do). A closer should move point to after the wrapping.

Patch welcome.

> - additionally one should be able to customize if points ends up
>   inside or outside the wrapped region.

I don't see a strong need for such customization, but I wouldn't object.


reply via email to

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