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 17:48:52 +0300

> From: Stefan Monnier <address@hidden>
> Date: Mon, 01 Aug 2016 10:36:42 -0400
> Cc: address@hidden
> 
> > Btw, it looks like insert-file-contents deliberately doesn't call
> > before-change-functions if nothing was inserted, even if some text was
> > deleted.
> 
> Sounds like a bug.
> 
> > I wonder why.  The way the code is written, it cannot be a
> > coincidence.
> 
> Coincidence or not, the b-c-f should we warned about the change.

But then why do we use a similar logic for after-change-functions?
Like this:

  if (inserted > 0 && total > 0
      && (NILP (visit) || !NILP (replace)))
    {
      signal_after_change (PT, 0, inserted);
      update_compositions (PT, PT, CHECK_BORDER);
    }

IOW, we don't call after-change-functions if nothing was inserted.



reply via email to

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