From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomasz Konojacki Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame Date: Wed, 20 Oct 2021 06:36:41 +0200 Message-ID: <20211020063638.8963.5C4F47F8@xenu.pl> References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8999"; 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 Wed Oct 20 06:37:30 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 1md3M0-0002DC-FF for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Oct 2021 06:37:29 +0200 Original-Received: from localhost ([::1]:52038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1md3Ly-00064O-OV for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Oct 2021 00:37:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1md3LK-0005OH-Go for emacs-devel@gnu.org; Wed, 20 Oct 2021 00:36:46 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:50327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1md3LI-0000hR-BG for emacs-devel@gnu.org; Wed, 20 Oct 2021 00:36:46 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6A1F85C01D4; Wed, 20 Oct 2021 00:36:41 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 20 Oct 2021 00:36:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xenu.pl; h=date :from:to:subject:cc:in-reply-to:references:message-id :mime-version:content-type:content-transfer-encoding; s=fm1; bh= 7iZrntOsQPUG+qB50dkq6j91vFpM8qUnLDAEVZG1fEQ=; b=JjQP6pkJBBWBlaUx 1bzDwZawee8zmmp6HqaYPo7I67GVlUDVII2GlRA94vaKYtk98LY9wAe+bgrTIMDH 4luGyCKWz9uIn+S5w7dvv2KPFAg5OhFbM52qbNQ28Cd4BkeAiz6hC4kmUFiNOPqR ftj4CK9L5R3JdCSctdMsHWhggfBqkBMb9CvDXX2D3huCo2q1k3XIHTtQSU3h/Hu3 1QaRu0dNU4pYP0ZKzzLH57XHmiW4ZDXYCWgdF6L0CPmEQNz2qPXMdRtD49aiYITv 3r6DlWlu6bPAihLuLrjggR+015jozA9PwQVu6P+I506rSxxIGx8Vec3Mfwozykin ClgP3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=7iZrntOsQPUG+qB50dkq6j91vFpM8qUnLDAEVZG1f EQ=; b=D1lxOoKN/8MODOxD1VM78TcYxrr+ywFIgMwtppxoqKnRnJFWrG9EGE8VM 3svVEER/7zSriVuJ5nbEcIubKsrQleA2A9BG/l+IPI63hBoxtTopP6wohOJXK/Sk Mq27dTr+xI9Ja6EQ4PqoSNxKFYj0MaTADqFFgwK3q5/ISfBAswLM4FT4q5Ehjt92 RRRjdtXGNfuqEHBRVtFOAneFocdJojCVZvDhYmrf23dPu3YlC29CJQ0K++nwvzgN K7ua1BBMvpjrdbQLuIXAr5ATbjkY5NKSuQrJRjEvAA83nhi5hf9ZYsCCTar8o08U kGKoZYyxob5RkwX6HLo9CzY4VhIaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvfedgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgjfhfkgggtgffosehtje ertdertddvnecuhfhrohhmpefvohhmrghsiicumfhonhhojhgrtghkihcuoehmvgesgigv nhhurdhplheqnecuggftrfgrthhtvghrnhepheeftdeftdefkeejvdffvdegveeuveefgf evuddufeekieeiudeugffgjedtkefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepmhgvseigvghnuhdrphhl X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 Oct 2021 00:36:40 -0400 (EDT) In-Reply-To: X-Mailer: Becky! ver. 2.75.04 [en] Received-SPF: pass client-ip=66.111.4.25; envelope-from=me@xenu.pl; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:277417 Archived-At: On Tue, 19 Oct 2021 21:20:35 -0700 Jim Porter wrote: > I've been experimenting with using `emacs --daemon' and found one part of it to be somewhat surprising. If I set `ALTERNATE_EDITOR' to the empty string and run emacsclient, it runs `emacs --daemon' and connects to it; so far so good. But when I close the Emacs client, the Emacs daemon sticks around; I'd prefer the daemon to stop as well. > > This would allow for a behavior similar to other (graphical) programs: if I run `firefox example.com', it starts a new instance as normal. If I run it again, it opens a new tab in the existing instance. If I close all the Firefox windows, all the associated processes terminate. > > I didn't see any options to configure this behavior in Emacs, but looking over the code, it shouldn't be that hard for me to write a patch to add this as an option. Before I started though, I wanted to see what others thought. Is this a behavior others would be interested in? If so, are there any other particulars I should take into account in my patch? > > - Jim You will get that behaviour if you put (server-start) in your init.el and set --alternate-editor to the emacs binary, not just an empty string.