GNU bug report logs -
#58909
29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Sun, 30 Oct 2022 22:30:02 UTC
Severity: normal
Tags: patch
Found in version 29.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 10/31/2022 12:52 PM, Eli Zaretskii wrote:
>> Date: Mon, 31 Oct 2022 12:38:04 -0700
>> From: Jim Porter <jporterbugs <at> gmail.com>
>> Cc: 58909 <at> 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.
This bug report was last modified 1 year and 259 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.