emacs-devel
[Top][All Lists]
Advanced

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

Re: timer.el API


From: Stefan Monnier
Subject: Re: timer.el API
Date: Mon, 03 Oct 2022 18:10:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Michael Heerdegen [2022-10-03 22:59:18] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> And its effect is very poorly defined in its docstring.  So whichever
>> behavior we choose for it, I'm sure someone can come up with
>> a legitimate case where that precise behavior is indeed needed.
>
> Madhu wrote:
>> The idea was to handle a "mode" where keystrokes would enter characters
>> in a "search string". the "mode" would timeout after a 10 seconds. If a
>> new character of the "search string" is read within the timeout period,
>> the timer is renewed ("respooled"). If a non "search string" character
>> is read, then the timer is cancelled and the "mode" exits.
> This is exactly the scheme I need now and then, and the only kind of
> task where I wanted `timer-activate'.

You don't need `timer-activate` for that: just deactivate your original
timer with `cancel-timer` and create a new one with
`run-with-idle-timer` if you need that.
Both of which are documented in the ELisp manual, contrary to
`timer-activate`.


        Stefan




reply via email to

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