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 09:07:36 +0300 Message-ID: <83h7daap1z.fsf@gnu.org> References: <20211020063638.8963.5C4F47F8@xenu.pl> <0ce055f1-23dc-0927-1098-b9629f2ccfe3@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: me@xenu.pl, 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 08:08:43 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 1mdRFr-00035c-Go for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Oct 2021 08:08:43 +0200 Original-Received: from localhost ([::1]:43100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdRFp-0001pC-Cy for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Oct 2021 02:08:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdREa-00016K-4u for emacs-devel@gnu.org; Thu, 21 Oct 2021 02:07:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40520) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdREZ-0006bH-Jp; Thu, 21 Oct 2021 02:07:23 -0400 Original-Received: from [87.69.77.57] (port=4433 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 1mdREZ-0002m6-6N; Thu, 21 Oct 2021 02:07:23 -0400 In-Reply-To: <0ce055f1-23dc-0927-1098-b9629f2ccfe3@gmail.com> (message from Jim Porter on Wed, 20 Oct 2021 13:07:02 -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:277500 Archived-At: > From: Jim Porter > Date: Wed, 20 Oct 2021 13:07:02 -0700 > Cc: emacs-devel@gnu.org > > > 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. > > Right, that's what I currently do. However, I've run into a couple > problems that have made me think `emacs --daemon' would be a better > solution. Under a non-daemon[1] configuration: > > 1) `org-protocol://' links don't work if Emacs isn't already running. > This is because org-protocol advises `server-visit-files' to detect when > a link with that protocol is passed as a file argument on the command > line. Since this argument is passed to the "alternate" Emacs, it's not > handled in `server-visit-files' and so the org-protocol code never runs. This sounds like a problem in org-protocol that should be solved there. If doing so requires some core feature we don't have, let's discuss that missing feature. But changing the behavior of the daemon, which will affect also all the other use cases unrelated to this one, is not TRT, IMO. > 2) The first place Emacs is opened is the "primary" instance. This isn't > usually a problem when you only run Emacs graphically, but if mixing GUI > and terminal instances, it'd be nice to allow closing the first instance > and keep the others open. For example, if you start editing in a > terminal Emacs and open a GUI Emacs client, the GUI Emacs can only live > as long as the terminal one. I don't follow this one. What exactly do you mean by "primary" here, and what do you mean by "instance"? In the scenario you described there's only one instance of Emacs running, as I'm sure you know very well. Please elaborate.