From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregor Zattler Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame Date: Sat, 23 Oct 2021 09:45:00 +0200 Message-ID: <87bl3gchhf.fsf@no.workgroup> References: <87lf2kale2.fsf@no.workgroup> <83zgr05kfk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24765"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 23 10:01:45 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 1meByL-0006Ig-5j for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Oct 2021 10:01:45 +0200 Original-Received: from localhost ([::1]:34808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meByI-0000GJ-Rq for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Oct 2021 04:01:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meBiN-0006T2-3W for emacs-devel@gnu.org; Sat, 23 Oct 2021 03:45:15 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:41781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meBiI-0002ez-FK for emacs-devel@gnu.org; Sat, 23 Oct 2021 03:45:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1634975105; bh=GtUU9aaBCrgnTjKdRd6J+oQcMWgWFLKVEnUEN+QyWiY=; h=X-UI-Sender-Class:From:To:Subject:In-Reply-To:References:Date; b=L6k7b9S1acgOjcepMtAOSl4l0L5v9Dpo4WlR/kQ5WIUJUphrwTzOR7wDsBmPNznhc w+ZisSlNklFIgf5jrFmkLmU5koWdJ4N3V7khWhlV5UXx9Hp+V5ra5DOHgCU/5XQZ7p bek/HeYiKDlZIcgxyyj4+gFuNtfrhVVv57vXAniQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from localhost ([46.94.150.161]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mv2xU-1mviYz1YPo-00r1UX; Sat, 23 Oct 2021 09:45:05 +0200 In-Reply-To: <83zgr05kfk.fsf@gnu.org> Mail-Followup-To: emacs-devel@gnu.org X-Provags-ID: V03:K1:s1ykDqPtk/VyWSnQiPfzmFpmpz2T+lvQVCqIC99Pa9X8J4l+aw6 d4AEuRu8zmo8/eK/bMQfB2Nm0fp43Aua2lh596RnBOB9zINiQZfuXz+7FFT1vCaBK4S16bo QdEztU+Si65Jd8camCqG5J8aLGi85C3gKJfiyhfZuPmw1krXv3M8671GhBzjvj/oCtwjgT/ ZzBzElFqZT5u+QVS5paKA== X-UI-Out-Filterresults: notjunk:1;V03:K0:JPzo6OfAi5o=:hK7XwHEoMOziV2yc264z2z vnXcHjYGmK0U+xKaUcHVjoFY4txaYL6Thhz9Sdim/+JRuts2G8Vd9fXl7HmhNuuqgsFGsO2jh wFEeNWl4G3HcLSfVKihwEiam6GKx7uvb0deDkJGXox2AuQydTuXH/II9+qCwIlqugY+dRoOap /VhRJ2yGWDXYIUW03aVBRsRayFDW7Dr4RBLyMMB9gsOdXEYUoZYKDRztlgPV0n0PaIgnov3Wu 31TYn+9Yfntzt3v9tP6VSQqDAvrjQ6ZTN6JH/0ALKnSghs0VszojH0NQQDOQdQSU6kF/fuwT2 LAlyPTi8nnwKRontwCSFaMnvUl7TmlsnMEeXH3AXK74xYvTzEr5CotaT7IfUK70TUEYhY4C31 +5ANzAjD5bVrnmdrkBHdlzZ7I5F57RlNbUQnCde0Lg80HLDw1BtEh+9zXvw5UWVkNryooJzVh rPdCQeo75tYcMqqze69ydjv/7C62RmvGAMigeYzs3z3ny4KTHwejLUK1kM7BuRp7JhZ3l8WKg 0lYxX/eiZ0dkCbqkTNhjiHZu2Guih2vwmbwEcze8hn/ASgIXS46+myKyrhH+j4zDn1duUTWGc n1dQRqZrSufxwfLy6qJA0gB0PSM8269ymDLHpVxuESNb2MeWdO5+uPjvvaUOOZwH/ZujwcDkk BYCHRwzLZ3UDmd2zkkNQkFaJI2JzZ5VcUHF14zAuTa1hyHMwh5Uz57Gncxc8X0BFpeH9vqqiE q4UAYoLtVt2uNDB3oLrhOt2Oof8e9C5szJbZZCYwpni+bfwGb5q7cGmtipgj6NURFCororOx Received-SPF: pass client-ip=212.227.17.20; envelope-from=telegraph@gmx.net; helo=mout.gmx.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:277600 Archived-At: Hi Eli, emacs developers, * Eli Zaretskii [2021-10-23; 09:23]: >> From: Gregor Zattler >> Date: Fri, 22 Oct 2021 21:51:17 +0200 >> * Eli Zaretskii [2021-10-21; 10:34]: >> > We could add a new command to the server-client protocol, and make >> > emacsclient send this command when invoked with the (hypothetical) ne= w >> > command-line option. >> >> But what happens then if there are two emacsclients >> connecting to the daemon, one with this hypothetical command >> line option, the other one without and the one without is >> the last client which closes it's connection with the >> daemon? > > The new protocol command will have been sent by the first emacsclient, > when it starts the server, so which client closes the last is > immaterial, because the decision when to exit will be by the server > based on that new server command it received in the beginning. Why is the order of events a given? If the protocol command is sent by emnacsclient because of a command line option, it's up to the user if and in which order s/he chooses to start emacsclients with/out this 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 t= rue, >> >> 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. >> >> Only if they want to use that new behaviour. Emacs users in >> most cases need to do that in order to use newly changed UI >> features. > > Yes, but the same is true for the new emacsclient command-line option, > except that changing that is easier done as one-time-only thing than > editing the init files. I for instance rarely call emacsclient by name from the command-line, but only for debugging reasons. In normal live I call it via shell scripts. These I would have to adapt, if I would want to make use of the new command-line option. I don't see a difference to the case of `daemon-kill-when-no-clients' defaulting to nil. At least this has to be set at only one place and could be done with the customization interface. Ciao; Gregor =2D- -... --- .-. . -.. ..--.. ...-.-