help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Repeating timers and suspending the computer


From: Marcin Borkowski
Subject: Re: Repeating timers and suspending the computer
Date: Wed, 14 Dec 2022 21:13:37 +0100
User-agent: mu4e 1.1.0; emacs 29.0.50

On 2022-12-13, at 13:32, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Marcin Borkowski <mbork@mbork.pl>
>> Cc: help-gnu-emacs@gnu.org
>> Date: Tue, 13 Dec 2022 06:16:53 +0100
>>
>> ;; If real time has jumped forward,
>> ;; perhaps because Emacs was suspended for a long time,
>> ;; limit how many times things get repeated.
>> (if (and (numberp timer-max-repeats)
>>          (time-less-p (timer--time timer) nil))
>>     (let ((repeats (/ (timer-until timer nil)
>>                       (timer--repeat-delay timer))))
>>       (if (> repeats timer-max-repeats)
>>           (timer-inc-time timer (* (timer--repeat-delay timer)
>>                                    repeats)))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> Do I get it correctly that this means that of the scheduled number of
>> repeats is /less/ than `timer-max-repeats', then all of them get
>> executed, but when it is greater than that, only one of them is?
>
> That's the idea, yes.

Thanks.  Any ideas how to rephrase the manual so that it is unambiguous?

Best,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

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