all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 58909@debbugs.gnu.org
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	[thread overview]
Message-ID: <cbe7fa28-a4d0-fb28-ef77-153d3df20454@gmail.com> (raw)
In-Reply-To: <837d0fepoz.fsf@gnu.org>

On 10/31/2022 12:52 PM, Eli Zaretskii wrote:
>> Date: Mon, 31 Oct 2022 12:38:04 -0700
>> From: Jim Porter <jporterbugs@gmail.com>
>> 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.





  reply	other threads:[~2022-10-31 20:28 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30 22:29 bug#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save Jim Porter
2022-10-31 12:44 ` Eli Zaretskii
2022-10-31 17:36   ` Jim Porter
2022-10-31 18:25     ` Eli Zaretskii
2022-10-31 19:38       ` Jim Porter
2022-10-31 19:52         ` Eli Zaretskii
2022-10-31 20:28           ` Jim Porter [this message]
2022-11-01  6:17             ` Eli Zaretskii
2022-10-31 19:28   ` Jim Porter
2022-10-31 19:43     ` Eli Zaretskii
2022-10-31 20:01       ` Jim Porter
2022-10-31 20:21         ` Eli Zaretskii
2022-10-31 21:06           ` Jim Porter
2022-11-01  6:39             ` Eli Zaretskii
2022-11-01 16:11               ` Jim Porter
2022-11-01 22:39                 ` Jim Porter
2022-11-02 12:16                   ` Eli Zaretskii
2022-11-02 16:36                     ` Jim Porter
2022-11-02 17:11                       ` Eli Zaretskii
2022-11-02 18:17                         ` Jim Porter
2022-11-02 18:42                           ` Eli Zaretskii
2022-11-02 19:16                             ` Jim Porter
2022-11-02 19:23                               ` Eli Zaretskii
2022-11-02 19:57                                 ` Jim Porter
2022-11-02 20:09                                   ` Eli Zaretskii
2022-11-02 22:09                                     ` bug#58909: 29.0.50; [PATCH] " Jim Porter
2022-11-03  6:25                                       ` Eli Zaretskii
2022-11-06 20:23                                         ` Jim Porter
2022-11-08 14:47                                           ` Eli Zaretskii
2022-11-08 15:08                                             ` Robert Pluim
2022-11-08 15:13                                               ` Eli Zaretskii
2022-11-08 15:29                                                 ` Robert Pluim
2022-11-08 16:52                                                   ` Jim Porter
2022-11-09 10:06                                                     ` Robert Pluim
2022-11-17  5:17                                                       ` Jim Porter
2023-09-07 21:03                                                         ` bug#58909: 29.0.50; [WIP PATCH] " Stefan Kangas
2023-09-08  1:21                                                           ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbe7fa28-a4d0-fb28-ef77-153d3df20454@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=58909@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.