From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame Date: Sat, 23 Oct 2021 13:38:43 -0700 Message-ID: <5ea58a3e-031c-9483-80af-e8e8e243ea65@gmail.com> References: <20211020063638.8963.5C4F47F8@xenu.pl> <0ce055f1-23dc-0927-1098-b9629f2ccfe3@gmail.com> <83h7daap1z.fsf@gnu.org> <331355ff-0b5b-2e6b-6abd-639c80d74a1b@gmail.com> <83o87h7e8l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32666"; mail-complaints-to="usenet@ciao.gmane.io" Cc: me@xenu.pl, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 23 22:39:50 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 1meNnx-0008Dk-8z for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Oct 2021 22:39:49 +0200 Original-Received: from localhost ([::1]:56692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meNnw-0002r2-0M for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Oct 2021 16:39:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meNmz-0001Te-3o for emacs-devel@gnu.org; Sat, 23 Oct 2021 16:38:49 -0400 Original-Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:40652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meNmx-00058v-3m; Sat, 23 Oct 2021 16:38:48 -0400 Original-Received: by mail-pg1-x530.google.com with SMTP id l186so286693pge.7; Sat, 23 Oct 2021 13:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=cXkBbKJ0EdNyH4wUZAnyMsqbtjdv1Ie4Q16aTTVUlgo=; b=d52pWUPZ5l0b7Lj0f2VdGkmGf56Hcnfr67iN6xzwZvSYuV1RHhhDOSAvYTy7RjghCv cw9//Sbo+foaZX0ysUxtCHpNYDFyhaF8HGVZMqW8bvwJyTBOF6mxNTHgo+nf3kyiSGg7 6/UxSoNJBQTaJacSgztRtHCXKHYCbAr9Z4307EElYqyVwgMt1mDzh4E7D+JlsLhdS4Hx rzkLl+XJMO+Icn3KkQ3WB/K5tJPwuiAQyCswbkFbsJxZhDDmkIHAjoc3FjJAZoUlFMFy xmX8purrBNLB8Kw+usP07vE9Y6Bfp5Xfz61Hz8P5xzWumL3gCWFqLpt9vQ+A8BMXmNpf /ujw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cXkBbKJ0EdNyH4wUZAnyMsqbtjdv1Ie4Q16aTTVUlgo=; b=xF44E+tMhTX7vNnBVVD8l65jeJ1emmfcUfbjj5WbqHkePqIL4MbLGSuUxQn5VWOTPI PgKG0VDIJf7nQDph+KvBpepSq6iWk5eiD7HDtRF39SLbuCoAAyycrSQEo0fyinyrukOs MQ3wgKho3MKE+CE4PD1wdMWImYi18rSe4ACg+Jj6SQql1srTKs/T7gzF6lyGMc3PPKhE RmPCofw9JAmq7RF7dmBJ93kuatfeERXQGURIv1PIv32T71CbIjInb77064m6hcaP5plH 9hFaf34fPn9E1rqOhgAmVIb68nHsaCma8pPusmPkwzjTiRjeadr8MaCLXpufN2FuxpfN L27A== X-Gm-Message-State: AOAM533LhLqjAehMq+c2D0Zpe4xhq8Cafk16hJ6TglKaLZ5BcnUAP/Kk lVN1WzI0IiQzPCT4e1BaDbwp9zZjX0c= X-Google-Smtp-Source: ABdhPJxlOqG/IazuZi2shzXFC4Kb7MbPE2SsMx+R2iOktBAi15NKRdElntUNFNz+y8hp/FXe2eLVtQ== X-Received: by 2002:a05:6a00:21c2:b0:44c:fa0b:f72 with SMTP id t2-20020a056a0021c200b0044cfa0b0f72mr7934681pfj.13.1635021525050; Sat, 23 Oct 2021 13:38:45 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id l12sm14960825pfu.100.2021.10.23.13.38.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Oct 2021 13:38:44 -0700 (PDT) In-Reply-To: <83o87h7e8l.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x530.google.com 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_DNSWL_NONE=-0.0001, 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:277628 Archived-At: On 10/21/2021 11:41 PM, Eli Zaretskii wrote: >> Cc: me@xenu.pl, emacs-devel@gnu.org >> From: Jim Porter >> Date: Thu, 21 Oct 2021 19:42:23 -0700 >> >> I hope an example will illustrate what I mean[1]. I start with two >> terminals open, A and B[2]. In terminal A, I run `emacs -nw foo.txt'. In >> terminal B, I run `emacsclient -nw -c bar.txt'. Now, suppose I want to >> stop editing foo.txt in terminal A and go back to doing something else. >> I'd type `C-x C-c', but then my emacsclient in terminal B will close too. > > No, it should say the session has client, and ask for confirmation. > > You also have C-z to temporarily suspend the session on A. Right. I glossed over those parts in an attempt to keep my explanation concise. This was just an example to show how `emacsclient --alternate-editor=emacs' requires the initial `emacs' process to live as long as all the other clients. This isn't a bug, just an illustration of a case where I prefer the way `emacs --daemon' works. >> However, using the daemon configuration with ALTERNATE_EDITOR="", I >> could run `emacsclient -nw -c ...' in each terminal. Then when I type >> `C-x C-c' in terminal A, it only kills that client, not the daemon >> process. I can then continue to edit in terminal B without interruption. >> >> Of course, this isn't a bug, it's just how emacs and emacsclient work >> together when not using `emacs --daemon'. It just turned out to be >> inconvenient for how I use Emacs, so I've moved to using `emacs >> --daemon' instead. > > Which is exactly why we provided the daemon mode, so I see no problem > here, I see a solution for a particular class of use patterns. Agreed. There's nothing *wrong* with this behavior per se; I was just trying to explain why I prefer how `emacs --daemon' works for my use pattern. - Jim