From: Gregory Heytings <gregory@heytings.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 51377@debbugs.gnu.org
Subject: bug#51377: Automatically exit server when it has no remaining clients
Date: Sun, 24 Oct 2021 20:42:12 +0000 [thread overview]
Message-ID: <90ba36dcccde742a3c60@heytings.org> (raw)
In-Reply-To: <b2114244-b9e4-c29f-e272-ba6cb26c5d1b@gmail.com>
>
> 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)))
next prev parent reply other threads:[~2021-10-24 20:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-24 15:15 bug#51377: Automatically exit server when it has no remaining clients Gregory Heytings
2021-10-24 16:03 ` Jim Porter
2021-10-24 16:14 ` Jim Porter
2021-10-24 16:32 ` Gregory Heytings
2021-10-24 18:08 ` Jim Porter
2021-10-24 18:43 ` Gregory Heytings
2021-10-24 19:39 ` Jim Porter
2021-10-24 20:42 ` Gregory Heytings [this message]
2021-10-24 21:19 ` Jim Porter
2021-10-24 21:37 ` Gregory Heytings
2021-10-25 18:21 ` Jim Porter
2021-10-26 10:37 ` Gregory Heytings
2021-10-26 11:59 ` Gregory Heytings
2021-10-26 15:07 ` Gregory Heytings
2021-11-11 5:43 ` Lars Ingebrigtsen
2021-10-24 21:40 ` Jim Porter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90ba36dcccde742a3c60@heytings.org \
--to=gregory@heytings.org \
--cc=51377@debbugs.gnu.org \
--cc=jporterbugs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).