[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: Phillip Lord
Subject: Re: Calling Lisp from undo.c's record_* functions
Date: Mon, 16 Nov 2015 21:51:49 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Question #1: do we really need to call Lisp from so deep inside the
> bowels of buffer manipulation routines?  Is that safe?  Perhaps we
> should reimplement undo-auto--undoable-change inC?
> Question #2: one solution is inhibit GC in run_undoable_change.  But
> since that could run arbitrary Lisp, is that a good idea? what if we
> run out of memory?
> Question #3: another possible solution is to set the current buffer's
> inhibit_shrinking flag around the call to Lisp in run_undoable_change
> -- is this better?  Note that this won't prevent GC in general, so the
> follow-up question is can insdel.c functions afford a GC while they
> run?
> Comments?  Suggestions?

Bah. I spent ages getting that working, and then you go and break it!

My immediate response would be a variation on #1. All
undo-auto--undoable-change really does is a "add-to-list" call. Easy to
reimplement this into C, I think.

The second thing it does is ensure that a timer is being run, which
seems a bit harder. Using an idle timer (the timer only does anything
when there are no commands happening) would solve the problem, although
(obviously) the timer would run when Emacs is entirely idle.

I'd be happy for Stefan to comment, as well.


reply via email to

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