[Top][All Lists]

[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: Fri, 11 Apr 2014 19:23:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (windows-nt)

Stefan Monnier <address@hidden> writes:

>> Would replacing (+ (point) <constant>) with (window-end) give reliable
>> behavior, from the user's perspective?  If the extra " is not visible,
>> it would not impact the result.
> No, the problem is not the distance, the problem is to find a position
> that we know is outside of a string.  There's no reason why
> (window-end) should be presumed to be outside of any string.

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.

reply via email to

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