[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: João Távora
Subject: Re: [patch] make electric-pair-mode smarter/more useful
Date: Mon, 16 Dec 2013 19:26:00 +0000

On Mon, Dec 16, 2013 at 3:34 AM, Stefan Monnier
<address@hidden> wrote:
>> I personally would prefer that the current rules would *not* be the
>> default in js-mode, as they are now, or any other mode).
> I understand what you're saying as "I don't like electric-layout-mode".
> FWIW, I agree with you.

Actually, no. Really. I just didn't expect it to behave like that. It's unseen
in any other editor. That intention to type everything without ever reaching
for RET, if candid, is very interesting. It's just a little foreign to me, and
probably more people. I think the newline-between-pairs rule is less foreign.

>> Anyway, the default value should really be the newline-between-pairs
>> rule, which currently only kicks in when electric-pair-mode is
>> additionally enabled (btw, should it not?).
> Enabling electric-pair-mode is definitely not on the table for 24.4, no.

Yes, of course. You misunterstood me. I meant that the rule's predicate
checks for electric-pair-mode before returning the symbol 'after-stay. It could
not care about it, so we get newlines between pairs with just

>> This is also possible, but overkill IMO.  I like the current triad of
>> electric modes.
> I don't think it's overkill at all.  It should be a separate minor mode
> and default to enabled (but still conditional on electric-pair-mode).
> I.e. make it part of electric-pair-mode and not try to shoe-horn it into
> electric-layout-mode.  I may have stated the opposite earlier, but
> I think it's pretty clear to me, now, that the purpose of
> electric-layout-mode is different.

Oh, pity, I much agreed with the earlier stefan :-(.

So a separate minor mode that on activation/deactivation adds/removes
the rule to/from the default value of electric-layout-rules, right?

But should the new minor mode automatically enable electric-pair-mode
and electric-layout-mode if it finds they're not enabled?

If it doesn't then a user who wants just the newlines will be surprised when
he enabled electric-newlines-mode and nothing happens...

OR did you mean a new minor mode completely independent from
electric-layout-mode, i.e., loose that 'after-stay nonsense that I proposed

João Távora

reply via email to

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