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.bugs Subject: bug#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save Date: Mon, 31 Oct 2022 20:25:24 +0200 Message-ID: <83bkpretpn.fsf@gnu.org> References: <9a70f868-ca50-52fc-af3e-23813af104f2@gmail.com> <83zgdcduxm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14794"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58909@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 19:26:25 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 1opZUO-0003g9-72 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 19:26:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opZU4-0007Fj-It; Mon, 31 Oct 2022 14:26:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opZU2-0007Ag-Bi for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 14:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opZU2-00037e-2k for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 14:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opZU1-0005z2-IW for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 14:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Oct 2022 18:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58909 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58909-submit@debbugs.gnu.org id=B58909.166724075322986 (code B ref 58909); Mon, 31 Oct 2022 18:26:01 +0000 Original-Received: (at 58909) by debbugs.gnu.org; 31 Oct 2022 18:25:53 +0000 Original-Received: from localhost ([127.0.0.1]:41747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opZTt-0005yf-GR for submit@debbugs.gnu.org; Mon, 31 Oct 2022 14:25:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opZTm-0005yM-2O for 58909@debbugs.gnu.org; Mon, 31 Oct 2022 14:25:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opZTf-0002sC-QO; Mon, 31 Oct 2022 14:25:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=rwHMhxLKK+Q3O0xN9cWkl8KtHdkvHTyT/aR4NCe0Alw=; b=LVPkjS+nsBc3/lZhokMv 4EEjZTvXWsw6JoULQ2ONc9dV/a86Z7k7T9TlQ5apCTFo3rfXFkNzQEoLh0f3Qf7g8YwDpN5qfOoE+ klBuvHM6MU5AVUj058y36aZVDkmK0fLkSmBJfxyB0ijqDOMy32tqPxw1l+MJX+SZ2VmZlJyF7r5Ye eoTdyXFPjnX4YnN4MriIsF3M3D2k+SNuN+lSjhJQylFlbr/ruw01qQOWf39uyGY+ilz5JGCHXNh3z WLDCaxjC7WukekKdQWxhY0cvmgPeLEzgsOVeRdFd5Z7eMuook/0hrTlgHKnUuDhOMdnK27yXlJEUB P4mUlI7xZZneHA==; Original-Received: from [87.69.77.57] (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 1opZTe-0001Jr-Qg; Mon, 31 Oct 2022 14:25:39 -0400 In-Reply-To: (message from Jim Porter on Mon, 31 Oct 2022 10:36:57 -0700) 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246712 Archived-At: > Date: Mon, 31 Oct 2022 10:36:57 -0700 > Cc: 58909@debbugs.gnu.org > From: Jim Porter > > On 10/31/2022 5:44 AM, Eli Zaretskii wrote: > > I'm uneasy with this incompatible behavior change. I can think of > > some legitimate use cases where "C-x 5 0" should not prompt, e.g., if > > the user intends to keep editing the file, and no application is > > waiting for the client to finish. Why break such flows? > > Maybe we should add an option like > 'server-save-before-deleting-last-frame', in case users prefer the old > behavior? I tend to think we shouldn't change the behavior here, not at all. Not even as an option. I see no problem here that we must solve. > Alternately, we could add a keybinding for 'server-edit-abort'. Users who need this can easily make a binding for them. There's no need to have such a binding by default. > Still another possibility would be to prompt only when closing a frame > by clicking the "X" on the frame's title bar. When using a > non-client/server Emacs, doing this prompts the user to save when > closing the last frame. ('C-x 5 0' in this case would just error out, > since it refuses to delete the last frame.) That's because clicking the > X calls 'handle-delete-frame' which calls 'save-buffers-kill-emacs' in > that case. Then clicking the "X" would behave similarly when deleting > the last frame of a client and deleting the last frame overall. But "last frame of a client" ≠ "the last frame". So I see no reason for a similar behavior. > > Deleting a frame does no harm as long as Emacs is still up and running > > after that, so IMO forcing the user to answer such a prompt could be > > an annoyance. > > I think it does about the same amount of harm as pressing 'C-x C-c' in > an emacs client. How can you say that? "C-x C-c" kills the entire terminal, whereas "C-x 5 0" kills just one frame! > Since my patch only affects the case when there's a single frame for > the client, both 'C-x C-c' and 'C-x 5 0' would do the same thing > (aside from prompting): they close the current frame and terminate > the client connection. I disagree, sorry. We are talking about maybe a minor inconvenience in a pretty special use case. It is unjustified to change long-time behavior for such weak reasons.