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.bugs Subject: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Date: Wed, 19 Oct 2022 20:14:38 -0700 Message-ID: References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.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="12466"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 20 05:22:39 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1olM8j-0002uV-Cc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Oct 2022 05:22:37 +0200 Original-Received: from localhost ([::1]:35768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olM8h-0002oQ-S0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Oct 2022 23:22:35 -0400 Original-Received: from [::1] (port=57882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olM1e-00057t-Fu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Oct 2022 23:15:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olM1O-000556-VY for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 23:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olM1O-0006bA-Hl for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 23:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1olM1O-000646-Bc for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 23:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2022 03:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51993 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51993-submit@debbugs.gnu.org id=B51993.166623569123283 (code B ref 51993); Thu, 20 Oct 2022 03:15:02 +0000 Original-Received: (at 51993) by debbugs.gnu.org; 20 Oct 2022 03:14:51 +0000 Original-Received: from localhost ([127.0.0.1]:60788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olM1C-00063S-SF for submit@debbugs.gnu.org; Wed, 19 Oct 2022 23:14:51 -0400 Original-Received: from mail-pf1-f172.google.com ([209.85.210.172]:45869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olM18-000639-9D for 51993@debbugs.gnu.org; Wed, 19 Oct 2022 23:14:49 -0400 Original-Received: by mail-pf1-f172.google.com with SMTP id 67so19035176pfz.12 for <51993@debbugs.gnu.org>; Wed, 19 Oct 2022 20:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=16GBFE3FVVXiaAJmIVmkV67kCmBD6Hq6pPkvuXsBozU=; b=BVeWDAI4I9dmlWZrVmLjdHLfenv43kGhB2vnB8Ojc0NWnL8+cr9ufjL1rWZ6Htl252 04Y7YU2O/sHAQTeUUH4HX5vI8/2PcRqrWW1F5o2jEZZtgkd8FZCPW7fGcqnpGlxPvuVN Lp8fQpLHOVo5lO8x47xzvkH3YGRrG8wy0NPqSuqBF4roN81rq9w3i5znh2W9zHPXWasS x6RNm0qUXnpVwDAr0PFUQVSxZbrfb0x8BoQ3AtVNdrVef13I9KZN8doOApguME2cuQk5 XFueomXGHfDIvwXSGHHWrzBl4A0Lf0zCKoqAZhPe0m72gmwXWRk9IdByV67G/BbKUXPU xGBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=16GBFE3FVVXiaAJmIVmkV67kCmBD6Hq6pPkvuXsBozU=; b=dnIDFqiER/zGLq3XGBLZwuiTv9iyWE9CDgphdHa0Pk7nocGalLk1nM8mNi4lUL9AUj bptU7tS9baZLcSC/FaLhmiSouqt9cDEfIFJ69W6NgpmWZYsQLCx06jLlcPMCf0jD9FUO vpC6lf94PWWTHV6EqR0WuQbvdIhkz/BDTlBCfqrj5cUYKhn/YvR1VUfWQrNtEX6LGmal p+XDhkt3I2vlBrfur2pCwgPR7dfkgMmfZs7ILSrgXN232ok4sNbajl4PIzwliTOD7m8I dyDl4KSjvF8jzbhAL+hua9ihtwQGXNXBbPcx20vmMdLzt90910li5qdNGVJiTht2C41J JzBQ== X-Gm-Message-State: ACrzQf0sh8O9OyOqoQsYkgKty+dCwuCNHN8B+Xbn23BxJMsYAAUv/jBJ WKsUJx7l6cQZZOeN8UqXPzo= X-Google-Smtp-Source: AMsMyM7PSv0cwU5j2ZApQlIFIfzGujy33OVw/+s5Oq0q/NJpAVNcqJnZgqISqDaSHxcvaUlfQRVdxg== X-Received: by 2002:a65:674e:0:b0:43c:3b91:236e with SMTP id c14-20020a65674e000000b0043c3b91236emr10028687pgu.510.1666235680250; Wed, 19 Oct 2022 20:14:40 -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 om13-20020a17090b3a8d00b00200b12f2bf5sm3469414pjb.1.2022.10.19.20.14.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 20:14:39 -0700 (PDT) Content-Language: en-US In-Reply-To: <83lepoi58p.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:245916 Archived-At: On 10/9/2022 11:04 PM, Eli Zaretskii wrote: >> Date: Sun, 9 Oct 2022 15:09:15 -0700 >> From: Jim Porter >> Cc: Eli Zaretskii , 51993@debbugs.gnu.org >> >> The patch adds two new hooks: 'server-before-delete-client-functions' >> and 'server-after-delete-client-functions'. These should give people the >> ability to add whatever behaviors they think make sense when closing an >> emacsclient connection. The default behavior is the same as the current >> default (call 'save-some-buffers' before deleting the client, and do >> nothing after). To do something like the 'delete-frame' configuration of >> the current 'server-stop-automatically' API, you might do something like >> this: > > Isn't this a bit of over-engineering for such a simple problem? Why > couldn't we have a user option to decide what to do, and then just do > it? The place where we delete client frames is well determined, so > doing something sensible there should be easy. I'd be happy with a simple user option, provided we can all agree how things should work (or if we can't *all* agree, that you and Lars can decide at least). I thought adding a hook might get around the problem of not being able to agree, though. I proposed a couple of behaviors that I described in as much detail as I could in the hopes of avoiding confusion and coming to an agreement here: . To summarize it briefly, the behavior I would personally prefer is this. When deleting an emacs client by any means (e.g. 'C-x C-c', clicking the X on the last frame of a client, etc): a) if this is not the last client, behave the same as Emacs 28: prompt to save files specified when starting "emacsclient", and then delete that client. b) if this *is* the last client, prompt the user to save everything (as with 'save-buffers-kill-emacs'), and then delete the client + kill the Emacs daemon. I'm certainly open to supporting other options if people have different preferences, and I can work on a patch to support these so long as we come to an agreement/decision/compromise about the expected behavior(s).