bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17036: Continuation for Emacs: invoking a process on exit?


From: Reuben Thomas
Subject: bug#17036: Continuation for Emacs: invoking a process on exit?
Date: Fri, 21 Mar 2014 10:18:30 +0000

On 21 March 2014 10:09, Reuben Thomas <address@hidden> wrote:

On 21 March 2014 07:53, Eli Zaretskii <address@hidden> wrote:
> Date: Thu, 20 Mar 2014 23:10:19 +0000
> From: Reuben Thomas <address@hidden>
> Cc: Stefan Monnier <address@hidden>, Andreas Schwab <address@hidden>,
>       address@hidden
>
> I'm sorry, I seem to have made a total hash of explaining something really
> simple. In effect, I want kill-emacs-and-exec, which takes a list of
> arguments, runs kill-emacs, and then execs the argument list.

As long as it does what you want, fine.  But please note that this is
not the same as exiting Emacs and starting a new session, because the
original Emacs didn't shut down all the way, and the PID is the same.

I think I'm still being unclear, sorry.

I am assuming that all the regular atexit handlers have already been called, and that Emacs is really about to exit. (That is what I mean by saying that kill-emacs has been run.) So, this could be implemented by ensuring that the first atexit handler to be registered on startup checks a "kill-emacs-and-exec" flag, and if it is set, does the exec. Correspondingly, kill-emacs-and-exec would set the flag, store the arguments in a suitable place, and then tail-call to kill-emacs.

And if there is a problem with keeping the same PID, or with file descriptors still being open, or any other kind of resource that is released on process exit, then by all means have the atexit handler mentioned above fork().

--
http://rrt.sc3d.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]