From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: sleep-for documentation and how to pause reliably Date: Fri, 15 Feb 2013 20:24:22 +0200 Message-ID: <83zjz5saeh.fsf@gnu.org> References: <83mwv6szif.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1360952672 1285 80.91.229.3 (15 Feb 2013 18:24:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Feb 2013 18:24:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 15 19:24:54 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 1U6Pxt-0007Sw-NU for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2013 19:24:53 +0100 Original-Received: from localhost ([::1]:56261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6PxZ-0008S4-Ly for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2013 13:24:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6PxU-0008R7-K3 for emacs-devel@gnu.org; Fri, 15 Feb 2013 13:24:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6PxR-0003uS-IM for emacs-devel@gnu.org; Fri, 15 Feb 2013 13:24:28 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:36471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6PxR-0003t8-7Z for emacs-devel@gnu.org; Fri, 15 Feb 2013 13:24:25 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MI900H00XQTSN00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Fri, 15 Feb 2013 20:24:22 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MI900HM0XSLF9B0@a-mtaout23.012.net.il>; Fri, 15 Feb 2013 20:24:22 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.175 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:157057 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Fri, 15 Feb 2013 11:11:43 -0500 > > > 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. 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. That said, I don't mind filing a bug report, if you think this should be fixed.