emacs-devel
[Top][All Lists]
Advanced

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

Re: Unbalanced change hooks (part 2) [Documentation fix still remaining]


From: Stefan Monnier
Subject: Re: Unbalanced change hooks (part 2) [Documentation fix still remaining]
Date: Tue, 30 Aug 2016 12:01:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> You are setting the bar impossibly high by expecting that.
> Implementing what you want would need significant changes in how the
> insdel functions are implemented and used.  In particular, some
> complex changes will probably have to do things twice: once just to
> figure out which changes are needed, the other time to actually do
> that while calling the hooks in the way you want.  That's because in
> some situations we discover the required changes as we go, and have no
> idea in advance what we will find.

Actually, we do have some idea beforehand, as evidenced by the fact that
we call b-c-f with valid data.  It's just that after the fact we have
a more precise knowledge of what has actually been changed, so a-c-f can
give more precise bounds.

But as mentioned in some other message, the a-c-f function can itself
extend its arguments to match those of the b-c-f if it needs them to
be matched.

We could also change the C code to perform this "extension" of the
region passed to a-c-f so that the b-c-f region and the a-c-f region
match, but that would make the region passed to a-c-f less precise, so
those users of a-c-f which don't care about the pairing (the majority of
the users) would be penalized (tho they'd still work correctly: just
suboptimally) since there's no way for them to recover the
tighter region.


        Stefan




reply via email to

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