emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs pretest -- electric-pair-mode change


From: João Távora
Subject: Re: Emacs pretest -- electric-pair-mode change
Date: Wed, 02 Apr 2014 18:21:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Stefan Monnier <address@hidden> writes:

>> Any chance this makes it to the pretests and 24.4?
>
> I don't think there's a hurry, in this respect.  It's a UI change, so we
> can change it later without breaking other people's code.

The problem is not breaking code, but users' expectations of the
upcoming feature. To undestand exactly what we're talking about: typing
a single " double quote in front with point at just before the "Hello"

    ss << Hello";

Will produce, both with and without the fix, the expected

    ss << "Hello";

But only with the fix will you get the same result when your buffer
contents are

    ss << Hello" << 42 << "World";

Without the fix you will get

    ss << ""Hello" << 42 << "World";

This last behaviour is also arguable but it is "way too clever", almost
buggy. The trunk's behaviour is better: it always inhibits pairing, the
surprising electric action, whenever there is unbalance, and as such is
more predictable.

>> `electric-pair-preserve-balance' is a new feature and the old behaviour
>> for quote-pairing will almost surely annoy any new adopters.
>
> We'll see if we get many complaints.

There might be complaints of people currently using my autopair.el that
follow my advice to go with electric-pair-mode in emacs 24.4. But I
can/will only tell them that once 24.4 is out.

>> Anyway I've haven't gotten little feedback for this feature, negative or
>> positive.
>
> `electric-pair-mode' (even the old one) is not a commonly used option,
> IIUC.  This is largely because it's not enabled by default, many people
> don't like/want such a feature, and those who do want it have many ways
> to get it, many of which predate electric-pair-mode.

There is a fair, maybe even great, number of people using autopair.el,
which does what Emacs's trunk now does, and smartparens.el which doesn't
provide any balancing at all.

But both being predictable, these users these packages are less likely
to switch or even try electric-pair-mode if it feels alien or hard to
predict, which IMO was *exactly* the problem with the "old"
electric-pair-mode.

> I do hope/expect it to become the standard way to get the feature,
> but it'll take a little while to get there.

I'm not arguing that it should be made default in 24.4 or even later
versions, but you can expect a slower route if releases contain this
particular gratutious idiosyncrasy, one that I regret having implemented
back in october without sufficent review/feedback (or am I mistaken and
did you or anyone else think about this particular edge case?)

João



reply via email to

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