[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function write-region resets idle time
From: |
Eli Zaretskii |
Subject: |
Re: Function write-region resets idle time |
Date: |
Thu, 11 Jan 2018 22:48:11 +0200 |
> From: Cecil Westerhof <Cecil@decebal.nl>
> Date: Thu, 11 Jan 2018 20:38:17 +0100
>
> And when I use:
> (setq timer-object (run-with-timer 30 30 'only-message))
>
> I get:
> Only message: (23127 48054 400127 610000) (0 29 996735 28000)
> Only message: (23127 48084 396995 23000) (0 59 993602 312000)
> Only message: (23127 48114 400137 106000) (0 89 996744 686000)
> Only message: (23127 48144 400100 220000) (0 119 996707 561000)
> Only message: (23127 48174 400122 394000) (0 149 996729 864000)
>
> So again, ONLY calling write-region does rest idle time.
With the original code you posted, I don't see the problem: the
idle-time advances by 30 sec every 30 sec. I tried on 2 different
systems, one of them GNU/Linux, the other MS-Windows, and I see
consistent behavior on both.
So it's something specific to your system. Somehow, write-region
causes Emacs on your system to receive some input event, and that
event resets the idleness time. Is what you see in "emacs -Q"? If
not, maybe you have something like global auto-revert-mode set, in
which case you get inotify event whenever you write to a file. Or
maybe some D-bus service does something similar?
In general, idle time is very fragile, and gets reset on any input
event. For example, I have focus-follows-mouse in my window manager,
and just moving the mouse into the Emacs frame resets the idle time on
that system, as expected.
> The behaviour changed (for me) on the 19th of December.
I don't understand this: you said you are using Emacs 24.5, so what
could have changed your Emacs on that date?
Re: Function write-region resets idle time, Cecil Westerhof, 2018/01/12