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: Eli Zaretskii
Subject: Re: Unbalanced change hooks (part 2)
Date: Mon, 01 Aug 2016 16:09:58 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Sun, 31 Jul 2016 17:59:32 -0400
> 
> >> 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"?
> 
> Either way is fine, according to my interpretation of "should see *all*
> changes".

Then I think we are fine, give or take a couple of minor changes that
might be needed in insert-file-contents.

Btw, it looks like insert-file-contents deliberately doesn't call
before-change-functions if nothing was inserted, even if some text was
deleted.  I wonder why.  The way the code is written, it cannot be a
coincidence.



reply via email to

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