[Top][All Lists]

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

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

From: Stefan Monnier
Subject: Re: Emacs pretest -- electric-pair-mode change
Date: Fri, 11 Apr 2014 15:58:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Re-reading Kevin's message I think there are two separate things here:

> * deciding if the buffer is quote-balanced for pairing purposes. That
>   can indeed only be done according to your idea Stefan, i.e. finding a
>   safe spot the we assert to be outside a string.

> * after having obtained reliable info that the buffer is unbalanced, we
>   can further decide if we want to surprise/disappoint the user. This
>   might be argued I think: if we know that there is an unbalance but
>   that it is outside the users view, decide to pair anyway.  If it is in
>   the user's view, try to repair the unbalance by not pairing (this
>   second bit is what is already done)

> I don't know if I personally would like it, perhaps it can be a
> customization option.

For strings, if we know that position POS, which should be outside of
a string, is inside a string, we know that there's an imbalance.  *But*
we don't actually know where that imbalance comes from (it's just
"somewhere before POS"), so we can't really tell if that imbalance is
before or after window-end unless POS is itself before window-end.


reply via email to

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