From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame Date: Thu, 21 Oct 2021 10:34:00 +0300 Message-ID: <838rymal1z.fsf@gnu.org> References: <83h7dbc2sl.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33228"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 21 09:35:29 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mdSbp-0008QZ-VT for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Oct 2021 09:35:29 +0200 Original-Received: from localhost ([::1]:47324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdSbo-0004bw-SQ for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Oct 2021 03:35:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdSaC-0002lp-Hk for emacs-devel@gnu.org; Thu, 21 Oct 2021 03:33:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42038) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdSaC-0003J4-8B; Thu, 21 Oct 2021 03:33:48 -0400 Original-Received: from [87.69.77.57] (port=1825 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdSaA-0008Nd-Qq; Thu, 21 Oct 2021 03:33:47 -0400 In-Reply-To: (message from Jim Porter on Wed, 20 Oct 2021 20:43:31 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:277502 Archived-At: > Cc: emacs-devel@gnu.org > From: Jim Porter > Date: Wed, 20 Oct 2021 20:43:31 -0700 > > > We could add an optional command-line argument to do what you want, > > but I wonder why would that be useful, when we already have > > kill-emacs. > > That's one option, although it might take a bit of work to support that > (assuming I understand what you mean). As far as I understand how > ALTERNATE_EDITOR works, there's not an easy way to automatically start > the Emacs daemon *and* provide it with some extra options. That is, > ALTERNATE_EDITOR="emacs --daemon --foo" would start the daemon, but > wouldn't create a client to connect to it. We could add a new command to the server-client protocol, and make emacsclient send this command when invoked with the (hypothetical) new command-line option. > Another method might be to add an option like > `daemon-kill-when-no-clients' that defaults to nil. Then after an > `emacsclient' is killed, we can consult that variable, and if it's true, > kill the daemon if there are no remaining clients. That'd require users to modify their init files, which I think is slightly less desirable than the alternative with a new protocol command.