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, 09 May 2018 19:40:17 +0100 Message-ID: <87efikd65q.fsf@gmail.com> References: <87tvrgd972.fsf@gmail.com> <83a7t8puaw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525891136 561 195.159.176.226 (9 May 2018 18:38:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 May 2018 18:38:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 09 20:38:52 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 1fGTzH-0008Tq-Jk for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 20:38:51 +0200 Original-Received: from localhost ([::1]:58488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGU1O-0002BL-NF for ged-emacs-devel@m.gmane.org; Wed, 09 May 2018 14:41:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGU0r-0002B1-HV for emacs-devel@gnu.org; Wed, 09 May 2018 14:40:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGU0m-0003WE-Bb for emacs-devel@gnu.org; Wed, 09 May 2018 14:40:29 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:39370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGU0m-0003Vi-4h; Wed, 09 May 2018 14:40:24 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id f8-v6so129206wmc.4; Wed, 09 May 2018 11:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=axmrnkbVBG9bJG63F42QXmG8rWkZUO7p8KbN/I9cb94=; b=kTSWm5OJ4NprqAzy+c7VDCh0EijGKq6tHOmtF+L1fusJVmtWP7zHnPGOtta3HxodCR qHqG5rHaJ4154cTgC/RYyPVf0oJPadZDLNZ8Hd4ibN5+odm3TTFsdac+NBENkH9I02H+ iA6w1/IWUiIqVN4MxjTYN3yrxeGFcwlvi556AyVSGRxiFFp5439/dCRPZPccoluR9M+j OqROSf/Uabi+6Xqd11UB3KDktgR7yj7qUIgzuMZIgu8jTJdD4poKG8n70dblzB4hjyuj sfd0k+1MMKhuKA9k55m57U7eqxQiqqTNSaJ6h9Ty0I38IdSUPEfSXeZyg6SVCexjW/cR w4iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=axmrnkbVBG9bJG63F42QXmG8rWkZUO7p8KbN/I9cb94=; b=kBgHGfQ/syANrke/CQVlX6uvSRClBmFUNVRlgFdG5OrYKsEfRBRE+lZRJWFEIeGiAs /JsUXFfKSUEZ8MI/2MVx+T/DVFl9IAZpKwaHboMtmUPPbApgnz9ybOHJvOAYjWQrvQmP /y6FEFzblyNGkv3WsScv612GpWSst045VS/BGiwSzurkbDRix74Pa11vJEP/38A2P9wY ClL3oVBJUeq9/CQRMii5x4FKm+njhmMAjn8ExqFc0l0cQBCt7AHbj7+u5GplEtnDyuhe jTdJaTEvjGSJo2Gw1oWbNdJ6j2ddGoBeKQp+x5R10QNpBC+4MIoT4CixlJeUVr0KTQ+r 4gYw== X-Gm-Message-State: ALQs6tB6mKGGKKgd5m7eW/bCHQt7bTyeFOwU31mLfG2FSKSDGtLZHCtv tYQ+7MkJG5/XYOqjwlAoTFRzIqQa X-Google-Smtp-Source: AB8JxZoo8MW/GbEmonCSMRJ2e7+s3u0QGf/ge2I17eMmK5OSJRtuWVmW9pH82uuE/2zNqwUVmPEhDA== X-Received: by 2002:a50:90fa:: with SMTP id d55-v6mr61322861eda.54.1525891222807; Wed, 09 May 2018 11:40:22 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id f16-v6sm15503202edr.32.2018.05.09.11.40.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 11:40:22 -0700 (PDT) In-Reply-To: <83a7t8puaw.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 09 May 2018 21:17:59 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22a 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:225172 Archived-At: Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Wed, 09 May 2018 18:34:41 +0100 >>=20 >> (catch 'done >> (run-with-idle-timer 1 nil (lambda () (throw 'done nil))) >> (while t (accept-process-output nil 0.1))) >>=20 >> Is it because accept-process-output means emacs isn't really idle? > More accurately, because Emacs is never idle for more than 0.1 sec, > and you requested the timer to run after 1 sec of idleness.>=20 > > ... > > Actually, yes, waiting in accept-process-output doesn't count as being > idle. Right. Ditto for sit-for and sleep-for, btw > Emacs considers itself idle only when it waits for input in its > main loop. Two follow-up questions (1) is this by design? (2) do interruptions by processes reset the idle time (I believe they should)?