Subject: bug#75361: 31.0.50; run-with-idle-timer not working unless there is some activity

From: Eli Zaretskii <[email-masked]>
Date: Sat, 04 Jan 2025 20:46:22 +0200

tags 75361 notabug
thanks

> From: Jean Louis <[email-masked]>
> Date: Sat, 04 Jan 2025 01:30:03 +0300
> 
> 
> The function is not working unless there is some activity. I remember it
> worked well in past, do not know what changed.
> 
> (defun my-message ()
>     (message (format-time-string "%T Hello")))
> 
> (run-with-idle-timer 10 t 'my-message)
> 
> >From that point I will see one hello message but if I do not touch
> anything it will not repeat.

That's expected.  From the ELisp manual:

     Emacs becomes “idle” when it starts waiting for user input (unless it
  waits for input with a timeout, *note Reading One Event::), and it
  remains idle until the user provides some input.  If a timer is set for
  five seconds of idleness, it runs approximately five seconds after Emacs
  first becomes idle.  Even if REPEAT is non-‘nil’, this timer will not
  run again as long as Emacs remains idle, because the duration of
  idleness will continue to increase and will not go down to five seconds
  again.

> That is bug.
> 
> It should be repeating the message each 10 seconds.

See above: your expectations are incorrect.

This is not a bug.