[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling Lisp from undo.c's record_* functions

From: Eli Zaretskii
Subject: Re: Calling Lisp from undo.c's record_* functions
Date: Tue, 17 Nov 2015 18:24:33 +0200

> From: Stefan Monnier <address@hidden>
> Cc: Eli Zaretskii <address@hidden>,  <address@hidden>
> Date: Tue, 17 Nov 2015 10:40:39 -0500
> > In theory, therefore, we should already be safe? Or can the critical
> > section be longer than a single function call to undo.c? Could the
> > unsafe period cover several calls?
> The problem is not in undo.c but in the fact that insdel.c calls
> record_insert at a moment where Elisp code can't be run.  So the call to
> record_insert would need to be moved.

Even if run_undoable_change doesn't call Lisp, but instead conses the
list by calling Fcons directly?  That's what Phillip did on his

> But of course, in reality it's not the whole record_insert that needs to
> be moved, only the run_undoable_change within it.
> So if it's difficult to move record_insert to safe spot, maybe we should
> take run_undoable_change out of it.
> E.g. maybe we could call run_undoable_change from
> prepare_to_modify_buffer instead.

Beware: prepare_to_modify_buffer is not always called.

Why call this at such a low level?  Why not at the level of
general_insert_function, Fdelete_region, etc.?  (Yes, that would be
more places to change, but so what?)

reply via email to

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