From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter Oliver Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Option to kill `emacs --daemon' when closing the last client frame Date: Mon, 25 Oct 2021 23:38:27 +0100 (BST) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2351"; 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 Tue Oct 26 00:41:10 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 1mf8eO-0000Ey-To for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Oct 2021 00:41:04 +0200 Original-Received: from localhost ([::1]:49028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mf8eM-00034d-LI for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Oct 2021 18:41:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mf8c1-0002MO-J6 for emacs-devel@gnu.org; Mon, 25 Oct 2021 18:38:37 -0400 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:39473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mf8bz-000465-4S for emacs-devel@gnu.org; Mon, 25 Oct 2021 18:38:36 -0400 Original-Received: by mail-wr1-x42c.google.com with SMTP id z14so14369363wrg.6 for ; Mon, 25 Oct 2021 15:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mavit.org.uk; s=google; h=date:from:to:subject:message-id:mime-version; bh=bUVM3vw4ikxSVratnejR9X5FtDZqc2x8AdZQn0U+GGg=; b=j85BPBFpz+8yXWj0KGRMWqRm+FczoN4rh/3M15KaL0F7iSxUfl5f1B6TfHtWI5IFq8 Kx6BHOJzwhuSsZtYsxMvu5kv7OyhR+54NqePDJsmQ3tVVFb3BzdpiRTwSQvcgBqHpnO5 zTPk07V59xy7Z2srAvWTfLGqEYmkUmK/eDNcA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=bUVM3vw4ikxSVratnejR9X5FtDZqc2x8AdZQn0U+GGg=; b=UtSZ8xkd0HSy3byvTbceVvXmdwVJ8uMmNxxTnz6nvc50+2O3Q5Uk62MQYtYT1jK9VB 3Borv/VaSb2bLhlaox1N0eEr+VSzF5Gl5kYw+UpCf4mZsNqJFe4iBqoj2PZcMoxR5sd5 rt8KKvqRWu4OnzB93HsoAmlu3uDFURzNB8/gvS+ixyHcctWUJh68NykmfwxaMpV8fs3k YZYxlGQshVjqSpWCg4fD34lGbuGGXkrNK7g1uGL1gdNOv9VRzL950JZkAIt/YGXB6osD 8GwolGljV2Joz4pZ2kkmnrbKjQFSDiloYBWc3VnNW4nJ7/z9VIaQ9M4IHTelQlftwrGq PC2g== X-Gm-Message-State: AOAM532OZmiv152vAekiGl12bWPFWjoDC5izFazQGJ3F+xJkPIv01yhQ rua4yeIyHWQYbh4C6QvdK/uPxKvl+tZeIg== X-Google-Smtp-Source: ABdhPJzV0YFhhmg99dbqa+D2kkauaX5b7J+twS3NeiNBJ4nrFYLpmXYxok1FbQqFFgHxF4+Ub2JDUA== X-Received: by 2002:a05:6000:184c:: with SMTP id c12mr27084184wri.379.1635201510114; Mon, 25 Oct 2021 15:38:30 -0700 (PDT) Original-Received: from froglet.home.mavit.org.uk (cpc118948-dudl14-2-0-cust32.16-1.cable.virginm.net. [82.37.201.33]) by smtp.gmail.com with ESMTPSA id b207sm9809784wmd.3.2021.10.25.15.38.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 15:38:29 -0700 (PDT) Original-Received: from froglet.home.mavit.org.uk (localhost [127.0.0.1]) by froglet.home.mavit.org.uk (8.16.1/8.15.2) with ESMTPS id 19PMcSUQ023216 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 25 Oct 2021 23:38:28 +0100 Original-Received: from localhost (mavit@localhost) by froglet.home.mavit.org.uk (8.16.1/8.16.1/Submit) with ESMTP id 19PMcRur023212 for ; Mon, 25 Oct 2021 23:38:28 +0100 X-Authentication-Warning: froglet.home.mavit.org.uk: mavit owned process doing -bs Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=p.d.oliver@mavit.org.uk; helo=mail-wr1-x42c.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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:277800 Archived-At: > > 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 guess it would make sense to try and distinguish the two cases: > > - Eager: `emacs --daemon` is run (typically from something like a login > script or systemd) before any emacsclient is involved. > - Lazy: `emacs --daemon` is started on-demand by the `-a` option > of `emacsclient` (or via ALTERNATE_EDITOR). > > In the lazy case, we could kill the daemon when the last client exits. The lazy behaviour seems suitable for the new emacsclient.desktop we have in Emacs 28, too. -- Peter Oliver