From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.bugs Subject: bug#17036: Continuation for Emacs: invoking a process on exit? Date: Wed, 19 Mar 2014 21:14:22 +0000 Message-ID: References: <874n2v9l10.fsf@igel.home> <8361na9lom.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01160d0ef3a82604f4fc2295 X-Trace: ger.gmane.org 1395263706 22147 80.91.229.3 (19 Mar 2014 21:15:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2014 21:15:06 +0000 (UTC) Cc: Andreas Schwab , 17036@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 19 22:15:16 2014 Return-path: Envelope-to: geb-bug-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 1WQNpT-00005E-7A for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Mar 2014 22:15:15 +0100 Original-Received: from localhost ([::1]:43787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQNpS-0006uo-P2 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Mar 2014 17:15:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQNpL-0006iN-44 for bug-gnu-emacs@gnu.org; Wed, 19 Mar 2014 17:15:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQNpH-0007uf-5l for bug-gnu-emacs@gnu.org; Wed, 19 Mar 2014 17:15:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQNpH-0007td-1r for bug-gnu-emacs@gnu.org; Wed, 19 Mar 2014 17:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WQNpG-0000mk-AT for bug-gnu-emacs@gnu.org; Wed, 19 Mar 2014 17:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Mar 2014 21:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17036 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17036-submit@debbugs.gnu.org id=B17036.13952636702958 (code B ref 17036); Wed, 19 Mar 2014 21:15:02 +0000 Original-Received: (at 17036) by debbugs.gnu.org; 19 Mar 2014 21:14:30 +0000 Original-Received: from localhost ([127.0.0.1]:41615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WQNoj-0000lc-Eq for submit@debbugs.gnu.org; Wed, 19 Mar 2014 17:14:29 -0400 Original-Received: from mail-yk0-f170.google.com ([209.85.160.170]:38702) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WQNoc-0000lQ-Nu for 17036@debbugs.gnu.org; Wed, 19 Mar 2014 17:14:27 -0400 Original-Received: by mail-yk0-f170.google.com with SMTP id 9so24754357ykp.1 for <17036@debbugs.gnu.org>; Wed, 19 Mar 2014 14:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=L1vqZT0JFrPJ/BKeROr3XT/QYovqvil466vo9u1Fh00=; b=r5VvCvzxKf750NEK9TD0t8ygOJuyGtN0Cbr+8xys0ywQ0itQCBMw1KPgwG1FlK5HqW UHWxT7mHtohVR2eFRjfKgKDe2CL9D5/cX4cKKXk0P7Iwc20lYOLKvjZetTjGeXmSzALa Fmc6zi6+mHCjIy/KrUBOh2jqSqW9IME01Gk8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=L1vqZT0JFrPJ/BKeROr3XT/QYovqvil466vo9u1Fh00=; b=LYXXQZRUazA7z/LIHK/ceSZI5SZ/YKuqoEEpSamgOD05V/97a/i6YPaY0QYAUz33Nq XhW385Xd28Y0jRE3GaKMNgjFg9QnHddSpR02im7YoXfzvtpuGkG4dC8V9kOZO8UrWIwW VT8hX7QxJFuvpH7iG13vhcjSKreKk4ZWG+VPbxAwogScuzmCPFVNsVaye3ynrDB5D6xv zCmMHPpJ7v8O0jFhqQE4l2bVk4Wm/4+ipMOy2RwA+3Tm3+f9aw+absO2gPBWR48eyHTW /i3o31cw3DCE6Q8FtYiS7JYP1Dke/R1t0t125f9m65ZMNMY/HH/imOP+NtBDvDwfVh8W iAvw== X-Gm-Message-State: ALoCoQkgKaKoYozbMDKLoRgnof/jyrF5y9Oz67KciH0KpmQ1qA4wNIj5tjW4jDZEhRBqAY+KQZsQ X-Received: by 10.236.206.7 with SMTP id k7mr14973559yho.84.1395263662155; Wed, 19 Mar 2014 14:14:22 -0700 (PDT) Original-Received: by 10.170.137.66 with HTTP; Wed, 19 Mar 2014 14:14:22 -0700 (PDT) In-Reply-To: <8361na9lom.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86995 Archived-At: --089e01160d0ef3a82604f4fc2295 Content-Type: text/plain; charset=ISO-8859-1 On 19 March 2014 16:51, Eli Zaretskii wrote: > > Date: Wed, 19 Mar 2014 13:19:28 +0000 > > From: Reuben Thomas > > Cc: Andreas Schwab , 17036@debbugs.gnu.org > > > > On 19 March 2014 13:10, Stefan wrote: > > > > > > I could imagine a `restart-emacs' command having some small utility. > > > > > > Could the w32 build support something like POSIX's `exec'? > > > > > > Windows has execvp... > http://msdn.microsoft.com/en-us/library/3xw6zy53.aspx > > Don't believe the sales people. MS's execvp is buggy, and even if we > forget about those bugs, it won't do what is expected here: it won't > keep the file descriptors open in the original process still open in > the overlaid process. That's because there's no 'exec' system call on > Windows, so execvp is _emulated_: the original process simply invokes > the new one as its child process, and then immediately exits. > That's good enough for restart-emacs. > So the answer to Stefan is: no, this cannot be done on Windows, not > without some custom code to let the re-executed Emacs inherit all of > the file descriptors which were open in the original Emacs process. > It's fine for what i had in mind, namely Emacs simply launching another command with arguments, much as a Lisp callcc. This could be documented as a limitation on Windows. -- http://rrt.sc3d.org --089e01160d0ef3a82604f4fc2295 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 1= 9 March 2014 16:51, Eli Zaretskii <eliz@gnu.org> wrote:
> Date: Wed, 19 Mar 2014 13:19:28 +0000
> From: Reuben Thomas <rrt@sc3d.org>
> Cc: Andreas Schwab <
schwab= @linux-m68k.org>, 17036@deb= bugs.gnu.org
>
> On 19 March 2014 13:10, Stefan <monnier@iro.umontreal.ca> wrote:
>
> > > I could imagine a `restart-emacs' command having some sm= all utility.
> >
> > Could the w32 build support something like POSIX's `exec'= ?
>
>
> Windows has execvp... http://msdn.microsoft.com/en-us/l= ibrary/3xw6zy53.aspx

Don't believe the sales people. =A0MS's execvp is buggy, and even i= f we
forget about those bugs, it won't do what is expected here: it won'= t
keep the file descriptors open in the original process still open in
the overlaid process. =A0That's because there's no 'exec' s= ystem call on
Windows, so execvp is _emulated_: the original process simply invokes
the new one as its child process, and then immediately exits.

That's good enough for restart-emacs.
<= div>=A0
So the answer to Stefan is: no, this cannot be done on Windows, not
without some custom code to let the re-executed Emacs inherit all of
the file descriptors which were open in the original Emacs process.

It's fine for w= hat i had in mind, namely Emacs simply launching another command with argum= ents, much as a Lisp callcc. This could be documented as a limitation on Wi= ndows.
--089e01160d0ef3a82604f4fc2295--