From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: sleep-for documentation and how to pause reliably Date: Fri, 15 Feb 2013 15:36:31 -0500 Message-ID: References: <83mwv6szif.fsf@gnu.org> <83zjz5saeh.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1360960603 13211 80.91.229.3 (15 Feb 2013 20:36:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Feb 2013 20:36:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 15 21:37:05 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U6S1o-0000I3-8A for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2013 21:37:04 +0100 Original-Received: from localhost ([::1]:35848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6S1U-0006se-K4 for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2013 15:36:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6S1P-0006rf-LP for emacs-devel@gnu.org; Fri, 15 Feb 2013 15:36:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6S1L-0005Nj-Mq for emacs-devel@gnu.org; Fri, 15 Feb 2013 15:36:39 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:51005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6S1I-0005Mf-HH; Fri, 15 Feb 2013 15:36:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxKjI/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av4EABK/CFFFxKjI/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="1528473" Original-Received: from 69-196-168-200.dsl.teksavvy.com (HELO pastel.home) ([69.196.168.200]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Feb 2013 15:36:31 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7EAB36F7D2; Fri, 15 Feb 2013 15:36:31 -0500 (EST) In-Reply-To: <83zjz5saeh.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Feb 2013 20:24:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157063 Archived-At: >> > However, in fact, sleep-for will return as soon as any input from any >> > subprocess arrives. >> That'd be a bug. > The implementation calls wait_reading_process_output, so I don't see > how it can behave otherwise, unless it calls that function in a loop > until the time passes. I think it should indeed do it in a loop. > Also, in the meantime I found this in the ELisp manual: > Output from a subprocess can arrive only while Emacs is waiting: when > reading terminal input (see the function `waiting-for-user-input-p'), > in `sit-for' and `sleep-for' (*note Waiting::), and in > `accept-process-output' (*note Accepting Output::). This minimizes the > problem of timing errors that usually plague parallel programming. > So this actually sounds like a deliberate feature. This doesn't say that it will interrupt sleep-for, only that process filters will be run during sleep-for. Stefan