From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: run emacs in batch mode without a tty Date: Sat, 04 Jul 2015 10:42:53 +0300 Message-ID: <83zj3cxtaa.fsf@gnu.org> References: <74b79522-cff4-4173-ad1c-178ffdce70fd@googlegroups.com> <91362e27-aad2-4aa8-bfa6-d447881103d1@googlegroups.com> <8f6a541f-2324-4d86-85b0-0472bed4f0a3@googlegroups.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1435995784 19263 80.91.229.3 (4 Jul 2015 07:43:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jul 2015 07:43:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 04 09:42:56 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZBI6B-0008G8-LG for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Jul 2015 09:42:55 +0200 Original-Received: from localhost ([::1]:43543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBI6A-0000Pf-NS for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Jul 2015 03:42:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBI60-0000Pa-QQ for help-gnu-emacs@gnu.org; Sat, 04 Jul 2015 03:42:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBI5x-0001ZO-Ip for help-gnu-emacs@gnu.org; Sat, 04 Jul 2015 03:42:44 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:60123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBI5x-0001ZF-Ao for help-gnu-emacs@gnu.org; Sat, 04 Jul 2015 03:42:41 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NQY00900CU7CZ00@mtaout28.012.net.il> for help-gnu-emacs@gnu.org; Sat, 04 Jul 2015 10:42:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQY00B2IDEVHG00@mtaout28.012.net.il> for help-gnu-emacs@gnu.org; Sat, 04 Jul 2015 10:42:31 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105422 Archived-At: > Date: Fri, 3 Jul 2015 15:01:18 -0700 (PDT) > From: Sam Halliday > > The docs say: > > "In batch mode (see Batch Mode), sit-for cannot be interrupted, even by input from the standard input descriptor. It is thus equivalent to sleep-for, which is described below." > > but I am pretty sure (sit-for seconds) *IS* interrupted by something. It is interrupted by input from your subprocess. > So... this > > (while t > (sleep-for 30)) > > Stops the script from ending until I'm ready to explicitly end it. You need to wait more intelligently, so that the wait never ends until you've received all the stuff from the subprocess, or until the subprocess dies, or whatever else is pertinent for your application. The fact that sleep-for (NOT sit-for!) is interrupted by subprocess input is arguably a bug, which was recently fixed in the development version of Emacs.