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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 10 Jan 2025 22:22:59 +0200

> Cc: [email-masked]
> Date: Fri, 10 Jan 2025 18:42:01 +0300
> From: Jean Louis <[email-masked]>
> 
> Thanks much.
> 
> (defun rcd-check-if-idle (&optional seconds)
>   "Verify if Emacs is idle for number of SECONDS.
> 
> If SECONDS is not provided, default is 3 seconds."
>        (cond ((and (current-idle-time) 
>        	      (>= (cadr (current-idle-time)) (or seconds 3)) t))
> 	  (t nil)))
> 
> I am using now this function to check if user is idle while running it
> `run-with-timer`.

current-idle-time doesn't measure the time the user is idle, it
measures the time Emacs is idle.  Emacs can have its processing
triggered by events other than user input.