emacs-devel
[Top][All Lists]
Advanced

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

disowning child processes?


From: Karl Chen
Subject: disowning child processes?
Date: Sat, 12 Apr 2008 15:27:17 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi,

Sometimes I start a web browser from Emacs (e.g. to view a http://
link in mail).  Then subsequently I open a bunch of other
windows/tabs in that browser process.  Then I want to close this
Emacs process, but can't because that would kill my browser
process, whose state I don't want to lose.

emacs -Q
M-: (browse-url-firefox "http://example.org";)
C-x C-c

[I don't use browse-url as the example here because on my system
that defaults to gnome-moz-remote which forks and returns so
doesn't have this issue.]

This particular issue might be solvable with helper scripts &
changes to browse-url-* only, but I'm wondering if it'd be useful
to add a general way to exit Emacs without killing certain child
processes---processes which were spawned from Emacs because it was
convenient, not because they have some lasting relationship to the
Emacs session.

In some shells, e.g. bash, zsh, there is a shell builtin "disown"
which makes a subprocess live on even if the shell exits or is
killed.  Does anyone else see utility in something analogous for
Emacs subprocesses, for example ``(set-process-kill-on-exit-flag
PROCESS nil)''.  The subprocess's stdio pipes will be closed but
that's generally acceptable for cases where not killing the
process makes sense.

This could be generalized for killing a buffer with associated
processes, though that seems like a less likely scenario.


Places likely touched by the addition of such a feature: struct
Lisp_Process, shut_down_emacs(), kill_buffer_processes(),
save-buffers-kill-emacs.

Thanks,
Karl





reply via email to

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