]> git.eshelyaron.com Git - sweep.git/commit
Handle SIGHUP in daemon mode when killing a tty top-level
authorEshel Yaron <me@eshelyaron.com>
Thu, 9 Nov 2023 19:47:57 +0000 (20:47 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 9 Nov 2023 19:47:57 +0000 (20:47 +0100)
commit68db64e554fa7e551d1c3e561b1ce9aa15a02aaf
tree3519aa5f469f7a11b925db9e9e6f4100bd3692d0
parent6c690d7dc91d18937d54a87d4801d4492de81492
Handle SIGHUP in daemon mode when killing a tty top-level

When Emacs is running as a daemon, and deletes the process of a
top-level that uses a tty, the top-level receives SIGHUP.  But since
the top-level is a thread is the same process as Emacs itself, this
results in 'kill-emacs'.  To prevent this unfortunate outcome, set a
no-op handler for SIGHUP before deleting the top-level process and
restore the original handler afterwards.

* sweep.pl (sweep_nohup/2): New predicate.
* sweeprolog.el (sweeprolog-top-level-filter): New function.
(sweeprolog-top-level-buffer): Use it.
sweep.pl
sweeprolog.el