From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#51377: Automatically exit server when it has no remaining clients Date: Sun, 24 Oct 2021 20:42:12 +0000 Message-ID: <90ba36dcccde742a3c60@heytings.org> References: <90ba36dccc00d6f0d62d@heytings.org> <63203d9f-dae7-a39f-c70f-ebf37632e642@gmail.com> <90ba36dcccc2abc8dec1@heytings.org> <7f3dde25-f81b-d7db-efc5-f8d471fd06bc@gmail.com> <90ba36dcccdc40168c93@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24587"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51377@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 24 22:43:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mekKk-0006Gl-Dn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 22:43:10 +0200 Original-Received: from localhost ([::1]:39140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mekKj-00049t-7z for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 16:43:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mekKc-00048n-9J for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 16:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mekKc-0002tt-0s for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 16:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mekKb-00046q-VR for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 16:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 20:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51377 X-GNU-PR-Package: emacs Original-Received: via spool by 51377-submit@debbugs.gnu.org id=B51377.163510813715721 (code B ref 51377); Sun, 24 Oct 2021 20:43:01 +0000 Original-Received: (at 51377) by debbugs.gnu.org; 24 Oct 2021 20:42:17 +0000 Original-Received: from localhost ([127.0.0.1]:41077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mekJt-00045V-9X for submit@debbugs.gnu.org; Sun, 24 Oct 2021 16:42:17 -0400 Original-Received: from heytings.org ([95.142.160.155]:33560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mekJq-00045L-88 for 51377@debbugs.gnu.org; Sun, 24 Oct 2021 16:42:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1635108133; bh=v5ZIQkRbPrW4IrNqTffTX9gSpOQRxEPW6xnDT9/nZkY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=lE6MOqsDMPjNEu5hmqwhhSc0EiE1B6tneFF6VtaslRLa9s3l4JMsltD9x/ctEAN8y dLaKN07Exiaj+IN4DHWBVYsv26XDK0B6KC6MQfmCuerRCxjsmpo1W+zybcFzdFiQfB GI42XA7vDP6M4J78Lx9PQ5Y/MoTxwIv6umOgi7vgsK8gAAfObpemAkr9GW37J6pfto WLzIRo6D+/ecAMCSwODWaIIUMwneYoE2y+BLuGmOcDqwDBFisAZvUvCa7t0kmr+GEc bSKBvCIbQFv1PkSVD4SGfXQRqb3LBrLGWuR7UoEdufhaNITwwjbs9S+im0JRrhtVVe 1tnnl0hRs1S+A== In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218205 Archived-At: > > 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)))