From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: run-with-timer vs run-with-idle-timer Date: Wed, 9 May 2018 21:18:02 +0100 Message-ID: References: <87tvrgd972.fsf@gmail.com> <83a7t8puaw.fsf@gnu.org> <87efikd65q.fsf@gmail.com> <838t8spsd5.fsf@gnu.org> <87tvrgbpys.fsf@gmail.com> <9ca64601-289b-c622-555a-9b5b9b6900aa@lanl.gov> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000cc0735056bcb9af0" X-Trace: blaine.gmane.org 1525896988 5834 195.159.176.226 (9 May 2018 20:16:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 May 2018 20:16:28 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 09 22:16:24 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 1fGVVe-0001OV-HA for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 22:16:22 +0200 Original-Received: from localhost ([::1]:58851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGVXl-0002VC-H7 for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 16:18:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGVXe-0002Uo-Id for emacs-devel@gnu.org; Wed, 09 May 2018 16:18:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGVXd-0002I7-MJ for emacs-devel@gnu.org; Wed, 09 May 2018 16:18:26 -0400 Original-Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:35783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGVXb-0002G9-RU; Wed, 09 May 2018 16:18:23 -0400 Original-Received: by mail-qt0-x229.google.com with SMTP id f5-v6so34066408qth.2; Wed, 09 May 2018 13:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=saDlPTnubrrQ7zAWkTOQnGjgrl6k/Ow9p7OQhmaJo5o=; b=PtWaEVlYdpBVCFhhClkGyxm0FLxlutPeSOL6+zH3kh8B88tKbvvaY0aq8FlhxEWGoi N/6gAVwPsA5v0HMHRjrluoT22NAr5i7F9IO6oqR1MWtqakem2NU4+gMaZFS/mf9F8Iuz lId4HBjlp9mxcJBe1qMraVKfVZs+DskVylTdheRycLWUPRgvy3RFAXLpn9wiY1Q9Le4U I25cCJ9OBP2y0ezBGvXO6B9SnO2U70HSRZETPDESAlI5T+t90mIhyF4COvTnH9DGaMcK YxrGtpxIZQxykfPWgcRF+S+MKpvw5dNu0NOZ2zOQwShjHQiHh7nHlvDuxf6endk31ML5 L0Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=saDlPTnubrrQ7zAWkTOQnGjgrl6k/Ow9p7OQhmaJo5o=; b=oSHvhBSsnNrJLMEuEG7eDVsfh6OGDJIAunBkoT93xZgMEZ5MR01A8CW68sPK9h+kGp nuDBhZO6y7sPHvVSMHXnC/q1/HfeUTBU3pnz3HbnQvzaFR4ShiAkDtbB8XOLcQfH7hE7 bPqmKJ58QucCOEau2oBvTXYx2u6xQcLydkGy2/xAAQeTEZycxAc6wE3V8GdUOjLxJC9M RoBCmabCly9zHCq+zgUbwxm7od4xX+Rljis2OhR4OhoAAPU9LhIUpIwTcjqIlWIkW3/x dgBoUSrnphe4Uj6Nz3w2w7ju1qVrbjr866USdxzDK5Fy/KqC7jlEHq+ML/666UvBNHbJ wPVA== X-Gm-Message-State: ALQs6tCaKNyrujlArPh0TEbWtcEhWuQW5MY6UudXu0wB73ZyUs1D/cwL X/CFbX75gx+XSaEJeB/20md8kQKcm9m9XvW9S8U= X-Google-Smtp-Source: AB8JxZqqp5YXYKK9MFfihVQGiNcm3Q5TeTUlSWVOzx8w1mRHAmcgplxBLEVErFyKL8oP7o9fobI6pBcSrVFr2hRqy04= X-Received: by 2002:a0c:9655:: with SMTP id 21-v6mr43021020qvy.226.1525897103147; Wed, 09 May 2018 13:18:23 -0700 (PDT) Original-Received: by 10.12.148.200 with HTTP; Wed, 9 May 2018 13:18:02 -0700 (PDT) In-Reply-To: <9ca64601-289b-c622-555a-9b5b9b6900aa@lanl.gov> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::229 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:225178 Archived-At: --000000000000cc0735056bcb9af0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 9, 2018 at 9:00 PM, Davis Herring wrote: >>> >>> 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. >> >> >> Doesn't this contradict what you told me first? I.e doesn't this >> contradict the fact that this never returns? >> >> (catch 'done >> (run-with-idle-timer 600 nil (lambda () (throw 'done nil))) >> (while t (accept-process-output nil 0.1))) ; 6 thousand times >> >> or should the manual be saying "even if subprocesses output has been >> non-explictly accepted thousands of times"? > > > No, because whatever command you used to invoke that code (C-x C-e in the trivial case) doesn't finish unless and until the loop finishes. So no time has yet "elapsed since the last user command was finished", regardless of anything about subprocesses. Indeed. (run-with-timer 1 nil (lambda () (catch 'done (run-with-idle-timer 3 nil (lambda () (throw 'done nil))) (while t (accept-process-output nil 0.1))) (message "ok!"))) Does print "ok". However this blocks typing for 3 seconds. So in a way, it forces idleness. Gross idea anyway. Wonder what happens in the filter... Jo=C3=A3o --000000000000cc0735056bcb9af0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, May 9, 2018 at 9:00 PM,= Davis Herring <herring@lanl.gov= > wrote:
>>>
>>> An idle timer set for 600 secon= ds will run when ten minutes have
>>> elapsed since the last us= er 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.
>>
&= gt;>
>> Doesn't this contradict what you told me first?=C2= =A0 I.e doesn't this
>> contradict the fact that this never re= turns?
>>
>> =C2=A0 =C2=A0(catch 'done
>> = =C2=A0 =C2=A0 =C2=A0(run-with-idle-timer 600 nil (lambda () (throw 'don= e nil)))
>> =C2=A0 =C2=A0 =C2=A0(while t (accept-process-output ni= l 0.1))) ; 6 thousand times
>>
>> or should the manual be= saying "even if subprocesses output has been
>> non-explictl= y accepted thousands of times"?
>
>
> No, because wh= atever command you used to invoke that code (C-x C-e in the trivial case) d= oesn't finish unless and until the loop finishes.=C2=A0 So no time has = yet "elapsed since the last user command was finished", regardles= s of anything about subprocesses.

Indeed.

(run-= with-timer
=C2=A01 nil
=C2=A0(lambda ()
=C2=A0 =C2=A0(= catch 'done
=C2=A0 =C2=A0 =C2=A0(run-wi= th-idle-timer 3 nil (lambda () (throw 'done nil)))
=C2=A0 =C2=A0 =C2=A0(while t (accept-process-output nil 0.1)))<= /div>
=C2=A0 =C2=A0(message "ok!")))

Does pri= nt "ok". However this blocks typing for 3 seconds. So in a way,
it forces idleness. Gross idea anyway. Wonde= r what happens in the filter...

<= div class=3D"gmail_extra">Jo=C3=A3o
--000000000000cc0735056bcb9af0--