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: Mon, 8 Aug 2016 20:16:13 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Stefan

On Mon, Aug 08, 2016 at 03:56:24PM -0400, Stefan Monnier wrote:
> > If it is indeed the case, then a solution to the problem would be to
> > check that before- and after-c-f are called alternately.  Any time
> > after-c-f is called twice in a row, we could reverse the change just made
> > (using the undo list), invoke before-c-f, redo the change, then let
> > after-c-f continue to completion.  If necessary, we can temporarily

> Sounds like piling up workarounds to make up for a mistake in the
> underlying design.

I couldn't agree more!

Anyway, we've now got what is surely a satisfactory solution: in the
event of a missing call to before-change-functions, assume that the
entirety of the buffer has changed (which is not far from the truth,
given that it happens on a `revert-buffer') and run
c-{before,after}-change on this basis.  See the patch in my latest post
to Eli.

This switches off some of the optimisations intended for revert-buffer,
but these seem no longer quite so pressing, given that reverting
xdisp.c, even with my latest patch, takes less than 0.2s on my 7 y.o.
machine; 20 years ago, things would have been different.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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