GNU bug report logs - #51377
Automatically exit server when it has no remaining clients

Previous Next

Package: emacs;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Sun, 24 Oct 2021 15:16:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 51377 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 51377 <at> debbugs.gnu.org
Subject: Re: bug#51377: Automatically exit server when it has no remaining
 clients
Date: Tue, 26 Oct 2021 10:37:38 +0000
[Message part 1 (text/plain, inline)]
>
> 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 (text/x-diff, attachment)]

This bug report was last modified 3 years and 256 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.