Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a function from run-with-idle-timer?

Tags:

emacs

elisp

I have added a lambda() function to run-with-idle-timer like this:

(run-with-idle-timer my-configurable-idle-time t
                 (lambda ()
                    ;;; do something
                  ) )

Is it possible to remove this function at a later point again from the idle timer trigger?

like image 892
Arne Avatar asked Mar 07 '13 13:03

Arne


1 Answers

Yes, run-with-idle-timer returns a timer object which you can pass to cancel-timer.

If you did not keep the timer object around, you can modify timer-idle-list by hand.

See also Getting a list of running Emacs timers.

like image 75
sds Avatar answered Nov 15 '22 18:11

sds