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: Alan Mackenzie
Subject: Re: Unbalanced change hooks (part 2)
Date: Tue, 9 Aug 2016 15:01:32 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Eli.

On Sun, Jul 31, 2016 at 06:03:19PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 31 Jul 2016 12:16:42 +0000
> > From: Alan Mackenzie <address@hidden>
> > Cc: Óscar Fuentes <address@hidden>,
> >     Richard Copley <address@hidden>

> > I propose that the call to signal_before_change should be removed from
> > prepare_to_modify_buffer, and that it should be called explicitly from
> > the places it is needed.  This would allow bug #240[79]4 to be fixed.

> > Comments?

> Some.

> First, I don't agree with your conclusion that calls to
> before-change-functions and after-change-functions must always be
> balanced.  For starters, they aren't, and never have been.

I don't think this is true.  A data point is that in XEmacs's insdel.c
(which is quite a bit simpler than Emacs's) the calls to b-c-f and a-c-f
are balanced.  Bug #24049 doesn't trigger on XEmacs.  I think it's
likely this balance existed in Emacs until some time after the Lucid
Emacs fork.

My guess is that originally these hooks were _intended_ to be balanced
(as they still are, at least to a very great extent, on XEmacs).  At
some stage (probably in the late 1990s/early 2000s) optimisations were
made in insdel.c and elsewhere, and the strict pairing of b-c-f and
a-c-f got lost in the wash.  At that time, very little, if anything,
used b-c-f, hence there was nothing to signal alarm bells during the
testing of the optimisations.

As I said, that's my guess.  I've tried searching the emacs-devel
archive for early discussions on the topic, but not found anything.

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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