GNU bug report logs -
#78042
31.0.50; Improper sequence of `before/after-change-functions` calls
Previous Next
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
> 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.
Stefan
This bug report was last modified 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.