GNU bug report logs - #78042
31.0.50; Improper sequence of `before/after-change-functions` calls

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 24 Apr 2025 15:40:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78042 <at> debbugs.gnu.org
Subject: bug#78042: 31.0.50; Improper sequence of `before/after-change-functions` calls
Date: Fri, 25 Apr 2025 21:39:46 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 78042 <at> debbugs.gnu.org
> Date: Fri, 25 Apr 2025 12:37:34 -0400
> 
> > Sorry, I don't think I understand the problem.  Is the problem that we
> > have "nested" notifications, whereby you have
> >
> >   before-change-functions A1 B1
> >   before-change-functions A2 B2
> >   after-change-functions  A2 B2
> >   after-change-functions  A1 B1
> >
> > IOW, _any_ situation where we have nested pairs of notifications is
> > "breaking our promise"?
> 
> Yup: the `before-change-functions A2 B2` promises that there won't be
> any changes to the buffer outside of A2...B2 until the next
> `before-change-functions`.
> 
> > If so, how can that be avoided in principle in Emacs, given its
> > recursive nature, except by some mechanism which collects all the
> > notifications and rearranges them to "keep our promise"?
> 
> There is currently no attempt in the C code to solve this "by
> construction" or "by design".  Instead we fix the offenders as we bump
> into them.

I submit that we will never be able to solve all of them.




This bug report was last modified 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.