emacs-devel
[Top][All Lists]
Advanced

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

Re: Unbalanced change hooks (part 2)


From: Stefan Monnier
Subject: Re: Unbalanced change hooks (part 2)
Date: Sun, 07 Aug 2016 11:09:52 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> Maybe it could, but that's not the point.  The point here is that after
> deleting "\"foo(" (or part of it), the closing delimiter must be found,
> even if all that is going to be done is to remove a string fence
> property from it.  How will one find this closing delimiter without
> knowing that the identifier in it is "foo"?  Indeed, how will one know
> to find it without even knowing that a raw string delimiter has been
> removed?

Because the text-property on the remaining text says "I'm in the middle
of a raw-string" and it says so until the end of that raw-string, hence
telling you where was the end.

> Or one could note the state before a change, and see how the change
> changes it.

Experience shows that this approach is a lot more complex, especially if
you take into account that before- and after- change-functions calls aren't
guaranteed to come in pairs.

In any case the question was not "can the CC-mode way be made to work"
but "is it the only way".  If it was the only way, it would make sense
to try and support it better.  But it's far from the only way, and
I have enough experience in those matters to even claim that it's far
from being the best way.



        Stefan



reply via email to

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