[Top][All Lists]

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

Re: Unbalanced change hooks (part 2)

From: Eli Zaretskii
Subject: Re: Unbalanced change hooks (part 2)
Date: Sun, 31 Jul 2016 22:26:34 +0300

> From: Stefan Monnier <address@hidden>
> Date: Sun, 31 Jul 2016 14:55:32 -0400
> >     These hook variables let you arrange to take notice of ALL changes
> >     in ALL buffers.  [My emphasis]
> >
> > Your interpretation of that seems to be that each buffer change will
> > call _at least_ one of before-... and after-..., but not necessarily
> > both.  That doesn't seem sensible to me.
> I fully agree that if you only use before-change-functions (or only use
> after-change-functions), your hook function should see *all* changes.

The change in question is a replacement.  Emacs implements
replacements by a deletion followed by an insertion.  The question is:
do we need to call the before-change-functions for both the deletion
and the insertion, or do we need to call them only once for the
"replacement"?  We currently do the latter, i.e. call them only once.
If you think that's incorrect, please explain why.

reply via email to

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