| Newsgroups |
gmane.emacs.help |
| Message-ID |
<[email protected]> |
On 2026-02-26, at 09:24, Michael Heerdegen via Users list for the GNU Emacs text editor <[email protected]> wrote:
> [email protected] writes:
>
>> Hi all,
>>
>> I'd like to tell Emacs "start counting the idle time from now", even if
>> the user didn't do anything. How to do that?
>>
>> I asked an LLM, and it told me to say
>>
>> (setq unread-command-events '(t))
>>
>> However, it had troubles explaining why I should use `(t)'. The docs
>> for `unread-command-events' didn't help much, either. By trial and
>> error I found out that
>>
>> (setq unread-command-events nil)
>>
>> is better in the sense that it doesn't pollute `view-lossage'. Is that
>> a correct way? Is that the best way?
>
> Your subject says "How to reset the idle timer". "Timer" or "Time"?
> What do you want to do, and for what purpose?
Good point. I don't mean an "idle timer" in the sense of Emacs idle
timers (my bad, not the best wording), but the internal something Emacs
uses to know when to fire idle timers - so to speak, the "master idle
timer".
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.
Sorry if this is a bit chaotic, I hope that it clarifies my intentions
a bit.
TIA,
--
Marcin Borkowski
https://mbork.pl