GNU bug report logs - #75361
31.0.50; run-with-idle-timer not working unless there is some activity

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Sat, 4 Jan 2025 17:39:01 UTC

Severity: normal

Tags: notabug

Found in version 31.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jean Louis <bugs <at> gnu.support>
Cc: 75361 <at> debbugs.gnu.org, shipmints <at> gmail.com
Subject: bug#75361: SOLVED - Re: bug#75361: 31.0.50; run-with-idle-timer not working unless there is some activity
Date: Fri, 10 Jan 2025 22:22:59 +0200
> Cc: 75361 <at> debbugs.gnu.org
> Date: Fri, 10 Jan 2025 18:42:01 +0300
> From: Jean Louis <bugs <at> gnu.support>
> 
> 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.




This bug report was last modified 211 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.