emacs-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: Re: Calling Lisp from undo.c's record_* functions
Date: Tue, 17 Nov 2015 12:34:08 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> When would it not be called?
> E.g., in insert_from_gap.  Also, in many insdel.c functions when they
> are called with the PREPARE argument false.

AFAIK these are cases where prepare_to_modify_buffer has already been
called earlier.

>> You mean there are cases where we'd add stuff to the undo list but
>> we don't run before-change-functions?
> I don't know.  I don't think we have such bugs, but thinking is one
> thing and convincing yourself it's true by looking at the callers is
> something entirely different...

That's OK, then: I believe that failing to call run_undoable_change is
not more serious than failing to run before-change-functions.

So I think moving the call to run_undoable_change into
prepare_to_modify_buffer is n attractive solution to this problem, since
it preserves the use of Elisp, and it probably also simplifies the code
(since we can remove most/all other calls to run_undoable_change).


        Stefan



reply via email to

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