From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Function write-region resets idle time Date: Thu, 11 Jan 2018 22:48:11 +0200 Message-ID: <83373c3ywk.fsf@gnu.org> References: <87r2qw9tpi.fsf@munus.decebal.nl> <87a7xki4xk.fsf@munus.decebal.nl> <87fu7ci3ti.fsf@munus.decebal.nl> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515703616 3398 195.159.176.226 (11 Jan 2018 20:46:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Jan 2018 20:46:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 11 21:46:52 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZjkP-0000Kh-VO for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jan 2018 21:46:50 +0100 Original-Received: from localhost ([::1]:41644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZjmP-00016q-Ii for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jan 2018 15:48:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZjlr-00016B-0E for help-gnu-emacs@gnu.org; Thu, 11 Jan 2018 15:48:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZjln-0001gw-TY for help-gnu-emacs@gnu.org; Thu, 11 Jan 2018 15:48:19 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZjln-0001gp-Pg for help-gnu-emacs@gnu.org; Thu, 11 Jan 2018 15:48:15 -0500 Original-Received: from [176.228.60.248] (port=3296 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eZjln-0003yB-6C for help-gnu-emacs@gnu.org; Thu, 11 Jan 2018 15:48:15 -0500 In-reply-to: <87fu7ci3ti.fsf@munus.decebal.nl> (message from Cecil Westerhof on Thu, 11 Jan 2018 20:38:17 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115661 Archived-At: > From: Cecil Westerhof > 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?