Re: How to reset the idle timer?
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <[email protected]> |
> From: [email protected] > Cc: [email protected] > Date: Sun, 01 Mar 2026 08:57:07 +0100 > > Here is my use case. When I close my laptop (not sure what it's > technically called - sleep? hibernation?), and then open it again (say, > after a few hours), I'd like Emacs to set up an idle timer to do > something, say, 1 minute after I stop pressing any buttons. I have > a (not great, but working) way to run some Elisp after I open my laptop, > but when I set up an idle timer then, it runs immediately, since the > idle time is several hours. I'd like to reset that idle time so that my > idle timer will really run after 1 minute of idleness - so, 1 minute > /after/ opening the laptop if I don't do anything else, and later if > I do something in Emacs within 60 seconds of opening my laptop. When the laptop is open, call run-with-timer to set up a normal (non-idle) timer that runs 1 min after that, and in the timer function of that timer start an idle timer.