|
From: | Gregory Heytings |
Subject: | bug#51377: Automatically exit server when it has no remaining clients |
Date: | Tue, 26 Oct 2021 10:37:38 +0000 |
1) I think it should check whether there are other *clients*, not other *frames*.
No, because nowait client frames are not recorded as clients. There's no way around it, it's necessary to use frames.
3) `handle-delete-frame' (used when clicking the X button in your window manager) can also call `save-buffers-kill-emacs' if the user closed the last frame. The logic here should exclude the daemon frame from counting as another frame so that closing all frames via the window manager stops the daemon too.
If it's now also necessary to kill the daemon when you close the last Emacs frame with the window manager close button (I did not see this requirement in your original post), then it's also necessary to kill the daemon when you close the last Emacs frame with C-x 5 0 (delete-frame), because it's what Emacs tells you to do when you call emacsclient without a file argument.
Here's a combined patch, which implements the two desired behaviors, and which I believe handles all cases properly: delete-frame, handele-delete-frame, save-buffers-kill-terminal, wait and nowait clients.
Options-to-automatically-stop-the-Emacs-server.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |