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#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save Date: Mon, 31 Oct 2022 10:36:57 -0700 Message-ID: References: <9a70f868-ca50-52fc-af3e-23813af104f2@gmail.com> <83zgdcduxm.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="7726"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58909@debbugs.gnu.org To: Eli Zaretskii 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 18:38:46 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 1opYkI-0001mU-1h for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 18:38:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opYjk-0006hK-L3; Mon, 31 Oct 2022 13:38:20 -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 1opYja-0006eH-KT for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 13:38:03 -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 1opYja-0006Uf-91 for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 13:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opYja-0004Qe-3H for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 13:38: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: Mon, 31 Oct 2022 17:38:02 +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.166723782616941 (code B ref 58909); Mon, 31 Oct 2022 17:38:02 +0000 Original-Received: (at 58909) by debbugs.gnu.org; 31 Oct 2022 17:37:06 +0000 Original-Received: from localhost ([127.0.0.1]:41682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opYif-0004PA-On for submit@debbugs.gnu.org; Mon, 31 Oct 2022 13:37:06 -0400 Original-Received: from mail-pl1-f169.google.com ([209.85.214.169]:33513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opYid-0004Oh-Fv for 58909@debbugs.gnu.org; Mon, 31 Oct 2022 13:37:03 -0400 Original-Received: by mail-pl1-f169.google.com with SMTP id 4so11409806pli.0 for <58909@debbugs.gnu.org>; Mon, 31 Oct 2022 10:37:03 -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=jyythNiSKCKeyj/ttJNpNlqge63u+Bon7x88GkLNTt4=; b=Eeha9xDq2bQtUKmjywgpJ2ram7o1SGXJlouPb0C528DzAVBld6Pxpmig6ZbMXuoSh9 7J2HH+chu4lIAbZNVbrJzcSLU/aTfY1UQigWq0DU82YY7wblnKKVcIdN8fINQyVInj3f 9GPRpAta4LyxlTkKeno+HcqQkWFMjv7uJGTTn59ZER1o/7OfMf1s7n1o4dqWwVKemE+d x+FfyUnkOHTBhIN1chne1yZ9vdPBIuBiYQG7aw9yenXmaBzW3qeDYIX4bemXwSifbHPI irMSF0oL2kI2EkcBLg6JvknZZ6K10i9zu34rdfoV0Sq+5/szddFD7opyMdj4W68XoeOr 6s2Q== 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=jyythNiSKCKeyj/ttJNpNlqge63u+Bon7x88GkLNTt4=; b=5+9/ITACjGk0UoedE2xkVlRK8nkFHSJByYotBxBsnbGpDDbO2tZd00wNv6P/P+iEAn U+ydDBJMnibyTpQfe8j8smPucSacGex33ZUsVfv97npTOL1SgWc4MF8X0Z/CAKRfzTe+ ZMgYAVwN863mj1APp1cROZFeojbR4eu2/Pzyy/fVQKK6+kbxEjpZHyMrBs7b6pE0/JGA uTkuewCkCfK/ZlfyWI4odO9gelHqVZZlvnmCxkePZaH+hoW2xjQ4YCbb0q+1solfi7na rWovR7Km3X12uHfLxRhBTNliOvVFfidAQFymQbd71hZlGUxU+aV6XRA6HSgabNg999cF hD8w== X-Gm-Message-State: ACrzQf0H/Z2PKC3Nezv0m/yNh0MNSwJPdEUmNA3JGptdSpxK5wqL/sdd 19X1XL0xW7tckthj385CzqQ= X-Google-Smtp-Source: AMsMyM4hVyDXRTqm7IrAQG329/zxmgOHOn2+0FjOah2vjbXluTyc/7bUxGiRAAAtjJwf/Z00F/mVNg== X-Received: by 2002:a17:902:ec81:b0:187:1dbd:b86c with SMTP id x1-20020a170902ec8100b001871dbdb86cmr7492938plg.172.1667237817550; Mon, 31 Oct 2022 10:36:57 -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 p23-20020a63c157000000b0046fd180640asm1522097pgi.24.2022.10.31.10.36.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 10:36:56 -0700 (PDT) Content-Language: en-US In-Reply-To: <83zgdcduxm.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: , 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:246707 Archived-At: 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 had originally planned to add an option like this for the same reason you mention, but I didn't want to be too aggressive with adding extra options if they aren't really needed. Since you mentioned it too though, I think this should at least have an option. Alternately, we could add a keybinding for 'server-edit-abort'. Then users could easily use that command to support this flow. That has the benefit that it's a command which is explicitly for saying, "I'm done with this file and don't want to save it," though it does break users' muscle memory. 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. I think I prefer one of the first two though. > 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. 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.