GNU bug report logs - #65451
30.0.50; `after-change-functions' are not triggered in the same order the changes are made

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Tue, 22 Aug 2023 09:31:01 UTC

Severity: normal

Found in version 30.0.50

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

Bug is archived. No further changes may be made.

Full log


Message #77 received at 65451 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: acm <at> muc.de, yantar92 <at> posteo.net, 65451 <at> debbugs.gnu.org
Subject: Re: bug#65451: 30.0.50; `after-change-functions' are not triggered
 in the same order the changes are made
Date: Sat, 30 Mar 2024 17:11:02 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Ihor Radchenko <yantar92 <at> posteo.net>,  65451 <at> debbugs.gnu.org, Alan
>  Mackenzie <acm <at> muc.de>
> Date: Sat, 30 Mar 2024 09:51:59 -0400
> 
> > I think Org mode is relying on something it should not.  This
> > particular use case aside, Emacs is allowed to call a function that
> > changes the buffer from a function that itself changes the buffer, and
> > it is allowed to call that inner function _before_ it did all the
> > changes it intended to do.
> 
> AFAIK the above sequences breaks the promise we make about
> `before-change-functions` and `after-change-functions`.
> 
> Almost all the non-trivial users of those hooks (i.e. basically those
> that need to use both hooks) have extra sanity and raise the heads up in
> despair when faced with things like the above (my `track-changes.el`
> lacks such sanity checks, but that's because it's a PoC).

I still stand by my opinion: Org is relying on something it cannot
rely upon, not as long as a function that changes a buffer can be
called from another function which changes the same buffer.  I don't
see how we can avoid breaking code which relies on such assumptions,
not in general anyway.




This bug report was last modified 1 year and 104 days ago.

Previous Next


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