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],  [email protected]
> Date: Mon, 02 Mar 2026 05:21:59 +0100
> 
> On 2026-03-01, at 22:14, Eli Zaretskii <[email protected]> wrote:
> 
> >> > 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.
> >> 
> >> That's interesting.  I have a feeling that it's a bit convoluted and
> >> hackish, but then maybe so is my idea of "resetting" the idle time.
> >> Still, I think that a "reset" like this may be more elegant and simpler.
> >> WDYT?  Is `(setq unread-command-events nil)' a good idea, then?
> >
> > No, I don't think so.  It might work, by sheer luck.
> 
> Ok, sorry to still bother you, but why wouldn't it work?

Because what exactly restarts the idle time is elusive, hard to
explain with 110% accuracy, and might vary between systems.

> It seems robust for me, since it simulates the user doing something
> (admittedly, a "nil" something), and I performed a few tests
> (admittedly, not very extensive), and it seemed to work every
> time...

Why do you think that setting unread-command-events has any influence
on Emacs idleness?  There was no input event, so we (the Emacs
maintainers) could decide that doing so has no effect on idleness.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.