From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: run-with-timer vs run-with-idle-timer Date: Wed, 09 May 2018 21:59:50 +0300 Message-ID: <838t8spsd5.fsf@gnu.org> References: <87tvrgd972.fsf@gmail.com> <83a7t8puaw.fsf@gnu.org> <87efikd65q.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1525892268 14074 195.159.176.226 (9 May 2018 18:57:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 May 2018 18:57:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 09 20:57:44 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fGUHY-0003Xv-Ad for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 20:57:44 +0200 Original-Received: from localhost ([::1]:58529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGUJd-00044I-Jo for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 14:59:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGUJU-000444-8u for emacs-devel@gnu.org; Wed, 09 May 2018 14:59:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGUJQ-0003AS-8O for emacs-devel@gnu.org; Wed, 09 May 2018 14:59:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGUJQ-0003AO-4d; Wed, 09 May 2018 14:59:40 -0400 Original-Received: from [176.228.60.248] (port=4981 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fGUJP-0006F7-HZ; Wed, 09 May 2018 14:59:39 -0400 In-reply-to: <87efikd65q.fsf@gmail.com> (message from =?utf-8?B?Sm/Do28g?= =?utf-8?B?VMOhdm9yYQ==?= on Wed, 09 May 2018 19:40: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: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225173 Archived-At: > From: João Távora > Cc: emacs-devel@gnu.org > Date: Wed, 09 May 2018 19:40:17 +0100 > > > Emacs considers itself idle only when it waits for input in its > > main loop. > > Two follow-up questions (1) is this by design? I wasn't there when this was designed, but it certainly looks like that, because accept-process-output calls wait_reading_process_output in a way that avoids reading from keyboard or the rest of input events. > (2) do interruptions by processes reset the idle time (I believe > they should)? If by "interruptions" you mean when output some sub-process comes our way, then no. The ELisp manual explicitly says: Emacs becomes “idle” when it starts waiting for user input, and it remains idle until the user provides some input. Note the "user input" part. And the very next paragraph says: Emacs can do various things while idle: garbage collect, autosave or handle data from a subprocess. But these interludes during idleness do not interfere with idle timers, because they do not reset the clock of idleness to zero. An idle timer set for 600 seconds will run when ten minutes have elapsed since the last user command was finished, even if subprocess output has been accepted thousands of times within those ten minutes, and even if there have been garbage collections and autosaves.