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


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78042 <at> debbugs.gnu.org
Subject: Re: bug#78042: 31.0.50; Improper sequence of
 `before/after-change-functions` calls
Date: Sat, 26 Apr 2025 19:22:42 -0400
>> The problem is that it would change the semantics of
>> `after/before-change-functions`.  E.g. code that needs to match the
>> before with the after (e.g. CC-mode, Eglot, ...) would now need to be
>> adjusted to keep a stack of "pending befores" and the C code would need
>> to be reviewed to try and catch the few places where we currently run
>> `after-change-functions` several times after running
>> `before-change-functions` once.
>> 
>> IOW, we'd trade one set of corner-case breakage for another.
>
> Except that making us prepared to handle nested notifications will
> solve the problem for good.

I don't see why it'll be easier to find all the cases where we currently
call `after-change-functions` several times.

But maybe you're right.  It'll still be a breaking change, so it might
require introducing new hooks to replace
`after/before-change-functions`.  In the mean time, I'll keep fixing the
problems I bump into.


        Stefan





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.