[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: Tue, 17 Nov 2015 21:35:42 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Stefan Monnier <address@hidden>
>> Cc: address@hidden (Phillip Lord),  address@hidden
>> Date: Tue, 17 Nov 2015 11:51:25 -0500
>> > Would it work to have a non-idle timer that is started once at
>> > startup, and then never shut down, and have its job be put on some
>> > list that the timer will examine?
>> I ruled that out early on in the design cycle because I think it's wrong
>> for an application to have such constant background activity.
> OK, but then the same considerations should prohibit using an idle
> timer, no?

Yep, pretty much.

> How about the following idea: we don't start the timer from
> run_undoable_change; instead, we set a flag there that will be checked
> by the command loop when it finishes execution of a command, and the
> call to start the timer will be made then?

We don't need the timer when the command loops is running. The command
loop will add undo-boundaries.

> We don't really need to attempt to start the timer for each and every
> change of every buffer, do we?

At the moment, we do, yes -- note that we actually only start the timer
if one isn't already running.

There are other solutions. We could just count the number of undoable
events since the last command, and add a boundary once a threshold has
been reached.


reply via email to

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