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 13:28:01 -0700 Message-ID: References: <9a70f868-ca50-52fc-af3e-23813af104f2@gmail.com> <83zgdcduxm.fsf@gnu.org> <83bkpretpn.fsf@gnu.org> <837d0fepoz.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="27968"; 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 21:29:14 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 1opbPF-000779-Vy for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 21:29:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbP5-0007F2-Na; Mon, 31 Oct 2022 16:29:03 -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 1opbP4-0007ER-FV for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 16:29: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 1opbP4-0005yg-8a for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 16:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opbP3-0001B2-Tb for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 16:29:01 -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 20:29: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.16672480924460 (code B ref 58909); Mon, 31 Oct 2022 20:29:01 +0000 Original-Received: (at 58909) by debbugs.gnu.org; 31 Oct 2022 20:28:12 +0000 Original-Received: from localhost ([127.0.0.1]:41910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opbOF-00019s-OD for submit@debbugs.gnu.org; Mon, 31 Oct 2022 16:28:12 -0400 Original-Received: from mail-pj1-f49.google.com ([209.85.216.49]:40521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opbOD-00019c-NS for 58909@debbugs.gnu.org; Mon, 31 Oct 2022 16:28:10 -0400 Original-Received: by mail-pj1-f49.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso16928172pjg.5 for <58909@debbugs.gnu.org>; Mon, 31 Oct 2022 13:28:09 -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=+MmfvQpWNEMKRg5JSy+UwnpkwThKMShKGipjktS1shY=; b=OW3SH8fluJZAv1ExidRUSwcQbF7U0dscbiXfag9/68eNX/joOv3VsXsFe3TxAhlYvU ZVanVnXi1Fmfu0ULhvn6/Ev0VRPLg97ZIOqPR44HyWYXpmrRI5HQ6mHpqWDdgeXgXzgd EAxTT6M8sm8Zp0dpmldwZZtRqgF3ELyGiDBFAU/F9IiqwE3Xs0F+rv9GNFlCWVxbbTj2 rhIh2pgu8KhjWbiDb8FyrvfaYgLpnfYKjFGm4RKI6fnmlZevxnv/7ymzMXrv6H9qXt82 OYV0ySHSJn+IQ34jG6rjeETAe4KrwRYyY4trvseWoCHds5jJA1QAPmqJbo7yL9Tz8ZYl Zvmg== 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=+MmfvQpWNEMKRg5JSy+UwnpkwThKMShKGipjktS1shY=; b=8McDeBuC6CfwuB0ORZ05r3M002wAkv07jxINF7SbglT6HwQE73ptsgBb8hg3eQi2Gt D3tO4Xq8Ysoz9VDMGJZ5jkGEu0NyhTo2qLwlaekOOqiMsuRsNxEEElMGgjqd/U57YJ3E 8NH5VGTru/mQcDqn+QcDN2f4hYa9TuN2z/AZBQwbNS//Zbjd1HIZ9z/5ZjbBg/5smF+g h140bo1fojth41F+Fh/+NG6+xZ0Fe4yEuseh6pyiAG40B+LI/Ea+sQ9T0SDZGvgGSHj/ 90bbeuG4qD8JAohoVsPdtX874HuBL4DKFTYktZCmT3lx+K0u11xAUpo0rItuIGBZ1LaF I85w== X-Gm-Message-State: ACrzQf0NXNjFmMhv+lVZfDLB9xu0IdaDDyPcx4Kmv9hfNyNSXC4aZUuL V+Bx6zEQklQtQAr96lhv8XI= X-Google-Smtp-Source: AMsMyM5CxS1sT2LEHB5HSXcjF6AWf5QXpmUo0eaj4IxsuE174i/reXAWHf06n/PM7SVpsOZDkH8Z0Q== X-Received: by 2002:a17:902:d2d0:b0:186:9e90:699 with SMTP id n16-20020a170902d2d000b001869e900699mr16241472plc.172.1667248083736; Mon, 31 Oct 2022 13:28:03 -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 17-20020a17090a19d100b002036006d65bsm4606935pjj.39.2022.10.31.13.28.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 13:28:03 -0700 (PDT) Content-Language: en-US In-Reply-To: <837d0fepoz.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:246720 Archived-At: On 10/31/2022 12:52 PM, Eli Zaretskii wrote: >> Date: Mon, 31 Oct 2022 12:38:04 -0700 >> From: Jim Porter >> Cc: 58909@debbugs.gnu.org >> >> Still, >> 'C-x C-c' still prompts in that case too. My understanding is that it >> does so because when an application is waiting for the emacsclient to >> finish, you can't go back from killing the terminal/client; you *can* >> (usually) go back if you're only killing a frame. > > My interpretation of why "C-x C-c" prompts is that it does the same as > when you use it from a non-client frame. We want the same UX in both > cases. "C-x 5 0" should IMO likewise produce the same behavior in > both cases. That's actually my goal too: I'd like to ensure that the UX for a client frame is as similar as possible as for a non-client frame. Since we disagree on what that similarity should be, I guess that means we have different mental models for some part of this. If it helps, I'll try to explain how I think of it. From a client frame, 'C-x C-c' prompts to save all the file-buffers associated with that client, and then kills the client, which kills the frames for that client. That's similar to 'C-x C-c' in a non-client setting: it kills *all* frames and prompts to save *all* file-buffers. So I see the client as a "sub" Emacs: it owns some frames and (partially) owns some buffers. Commands on the client then work on that subset, and only that subset. Since frames can only be owned by a single client, in my mind frame commands also work within that client's subset. For frame-deletion, non-client Emacs lets you kill a single frame via 'C-x 5 0' or clicking the X in the frame's title bar. However, if it's the last frame, then: C-x 5 0 -> Error: "Attempt to delete the sole visible or iconified frame" Clicking X -> Call 'save-buffers-kill-emacs' (see 'handle-delete-frame') To me, that would mean that the matching UX for a client with a single frame (but possibly other frames for Emacs overall) is: C-x 5 0 -> Error Clicking X -> Call 'save-buffers-kill-terminal' Signaling an error for 'C-x 5 0' seems excessively strict to me, so calling 'save-buffers-kill-terminal' in both cases seemed like a good compromise to me. Instead of getting an error, the user gets a prompt, but can still proceed with killing that frame if they're sure.