[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Repeating timers and suspending the computer
From: |
Eli Zaretskii |
Subject: |
Re: Repeating timers and suspending the computer |
Date: |
Tue, 13 Dec 2022 14:32:12 +0200 |
> 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.
- Repeating timers and suspending the computer, Marcin Borkowski, 2022/12/09
- Re: Repeating timers and suspending the computer, Eli Zaretskii, 2022/12/09
- Re: Repeating timers and suspending the computer, Emanuel Berg, 2022/12/10
- Re: Repeating timers and suspending the computer, Marcin Borkowski, 2022/12/10
- Re: Repeating timers and suspending the computer, Eli Zaretskii, 2022/12/11
- Re: Repeating timers and suspending the computer, Marcin Borkowski, 2022/12/13
- Re: Repeating timers and suspending the computer,
Eli Zaretskii <=
- Re: Repeating timers and suspending the computer, Marcin Borkowski, 2022/12/14
- Re: Repeating timers and suspending the computer, Eli Zaretskii, 2022/12/15
- Re: Repeating timers and suspending the computer, Marcin Borkowski, 2022/12/15