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


View this message in rfc822 format

From: Gregory Heytings <gregory <at> heytings.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 51377 <at> debbugs.gnu.org
Subject: bug#51377: Automatically exit server when it has no remaining clients
Date: Sun, 24 Oct 2021 20:42:12 +0000
>
> Yeah, that looks like it should avoid any data loss. However, it's not 
> the behavior I'd personally expect. As I understand it, this will just 
> keep the Emacs daemon alive if there are any unsaved files.
>

Indeed.  And if there are any running processes.  This is I think the 
least surprising behavior for users who use the Emacs daemon.

>
> I'd find it easier to use if Emacs warned the user about unsaved files 
> before killing the last client. Then, Emacs can safely kill the daemon 
> once I've confirmed that that's what I want.
>

I'm not sure I understand why this would be better.

If want you want is to save unsaved buffers and stop the daemon when you 
close the last frame, you can simply use:

(defun save-buffers-kill-terminal (&optional arg)
  (interactive "P")
  (if (and (frame-parameter nil 'client)
	   (cddr (frame-list)))
      (server-save-buffers-kill-terminal arg)
    (save-buffers-kill-emacs arg)))




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

Previous Next


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