[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:35:56 +0200

> From: address@hidden (Phillip Lord)
> Cc: Eli Zaretskii <address@hidden>,  <address@hidden>
> Date: Tue, 17 Nov 2015 14:42:44 +0000
> > The "critical section" is the span of code during which the buffer is
> > "being worked on" by the insertion function, so during this time, the
> > buffer shouldn't be modified by anyone else in any way: no Elisp code
> > should be run, no GC should take place.
> Assuming the documentation of undo.c is rigourously followed, then this
> should only be a problem for insert. All the others say "at the
> beginning of the command" or "about to happen". Only insertion says
> "before or after". Although, record_insert calls record_point which
> rather confuses me -- surely in record_insert can be after, so can
> record_point.

I don't recommend relying on such promises too much.  You can never
know if someone, some day violates it, whether consciously or
inadvertently.  In fact, it looks like replace_range already does just

> There are only 7 calls to record_insert so changing the so record_insert
> is *always* before would be possible.

Did you look at insert_from_gap?  AFAIU, it assumes that the gap
position stays put during the call to record_insert.  If that can call
Lisp or GC, that assumption is false.

> Big change to make at this point in the release cycle.

No, I don't think so.  We still have several months to go.

Btw, could you perhaps write a short description of this change and
its effects in the Lisp level for etc/NEWS?  I see there's not a word
about this there.  Bonus points if you also update the ELisp manual.


reply via email to

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