


Then it becomes idle again, and all the idle timers that are set up to repeat will subsequently run another time, one by one.ĭo not write an idle timer function containing a loop which does a certain amount of processing each time around, and exits when (input-pending-p) is non- nil. When the user supplies input, Emacs becomes non-idle while executing the input. An idle timer set for 600 seconds will run when ten minutes have elapsed since the last user command was finished, even if subprocess output has been accepted thousands of times within those ten minutes, and even if there have been garbage collections and autosaves. But these interludes during idleness do not interfere with idle timers, because they do not reset the clock of idleness to zero. 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.Įmacs can do various things while idle: garbage collect, autosave or handle data from a subprocess. If a timer is set for five seconds of idleness, it runs approximately five seconds after Emacs first becomes idle. The function run-with-idle-timer returns a timer value which you can use in calling cancel-timer (see Timers).Įmacs becomes idle when it starts waiting for user input, and it remains idle until the user provides some input. More often repeat is non- nil, which means to run the timer each time Emacs remains idle for secs seconds. If repeat is nil, the timer runs just once, the first time Emacs remains idle for a long enough time. The value of secs may be a number or a value of the type returned by current-idle-time. Set up a timer which runs the next time Emacs is idle for secs seconds.
#FACEBOOK IDLE TIMER HOW TO#
Aside from how to set them up, idle timers work just like ordinary timers.Ĭommand: run-with-idle-timer secs repeat function &rest args Here is how to set up a timer that runs when Emacs is idle for a certain length of time.
