From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Halliday Newsgroups: gmane.emacs.help Subject: Re: run emacs in batch mode without a tty Date: Fri, 3 Jul 2015 14:25:08 -0700 (PDT) Message-ID: 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 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435959028 18430 80.91.229.3 (3 Jul 2015 21:30:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2015 21:30:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 03 23:30:20 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 1ZB8XK-0001Di-Ao for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2015 23:30:18 +0200 Original-Received: from localhost ([::1]:42614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB8XJ-0007oz-BP for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2015 17:30:17 -0400 X-Received: by 10.182.186.67 with SMTP id fi3mr52511914obc.49.1435958708788; Fri, 03 Jul 2015 14:25:08 -0700 (PDT) X-Received: by 10.140.80.168 with SMTP id c37mr147960qgd.39.1435958708758; Fri, 03 Jul 2015 14:25:08 -0700 (PDT) Original-Path: usenet.stanford.edu!ff1no1201446igc.0!news-out.google.com!4ni39789qgh.1!nntp.google.com!w90no49437qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <8f6a541f-2324-4d86-85b0-0472bed4f0a3@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.13.129.22; posting-account=kRukCAoAAAANs-vsVh9dFwo5kp5pwnPz Original-NNTP-Posting-Host: 82.13.129.22 User-Agent: G2/1.0 Injection-Date: Fri, 03 Jul 2015 21:25:08 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:213122 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:105409 Archived-At: Aha! It would appear that when emacs is started in -batch mode then the pro= gram exits when it runs through the initial script. But my tests are starting up a process, attaching a sentinel and then react= ing to some triggers in that file. Under non-batch mode, emacs stays open u= ntil I call `kill-emacs`... but *now* it's dying too early. So my question then becomes: is there a way to stop emacs -batch from termi= nating when it reaches the end of the script? i.e. require an explicit kill= -emacs call. On Friday, 3 July 2015 21:43:27 UTC+1, Sam Halliday wrote: > On Friday, 3 July 2015 21:14:36 UTC+1, Eli Zaretskii wrote: > > > Date: Fri, 3 Jul 2015 10:07:06 -0700 (PDT) > > > From: Sam Halliday > > >=20 > > > > emacs -batch --eval "(princ \"Hello, world\!\n\")" < /dev/null > = foo > > >=20 > > > Aah, the difference is that you're using `-batch` > >=20 > > Excuse me? It was you who asked specifically about the batch mode: > >=20 > > > Is it possible to run emacs in batch mode without access to a tty? Is= there a way to mock a tty for these purposes? > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >=20 > I wasn't aware that there was a flag to turn emacs into a batch processor= . You can invoke commands and load lisp files for purely automated testing = without the -batch flag, and that is exactly what we are doing. I was calli= ng that batch mode, but now I don't know what to call it. >=20 >=20 > > > and that does allow me to do *some* things in the docker container, b= ut emacs seems to just exit when I start a `process`. The docs don't mentio= n this as a caveat http://www.emacswiki.org/emacs/BatchMode > >=20 > > What do you mean by "start a process"? >=20 > I mean start a http://www.gnu.org/software/emacs/manual/html_node/elisp/P= rocesses.html >=20 > > > Is there anything that you can think of that might cause a -batch ema= cs to exit early? > >=20 > > How do you see it exiting early? Please provide the details of what > > you see, as I have no way of trying this on a system similar to yours. >=20 > Well, this is literally all the information I have: the stdout >=20 > http://fommil.com/github.com/ensime/ensime-emacs/drone/ee99fc5d368cafc2dd= 583520f9fe8e9e23faadb6 >=20 > from running this script >=20 > https://github.com/fommil/ensime-emacs/blob/drone/test/run_emacs_tests.sh >=20 > The last thing we see is the output from this function call (which starts= the process) https://github.com/fommil/ensime-emacs/blob/drone/ensime-star= tup.el#L215 >=20 > So I'm interested to know what implication the -batch flag has for the fu= nctionality of emacs. Specifically: launching/monitoring processes, and nav= igating buffers (i.e. spoofing user actions). >=20 > Best regards, > Sam