GNU bug report logs - #58909
29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save

Previous Next

Package: emacs;

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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Porter <jporterbugs <at> gmail.com>
Subject: bug#58909: closed (Re: bug#58909: 29.0.50; [WIP PATCH] Deleting
 the last frame of an emacsclient doesn't ask to save)
Date: Fri, 08 Sep 2023 01:22:01 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient doesn't ask to save

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 58909 <at> debbugs.gnu.org.

-- 
58909: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58909
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 58909-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#58909: 29.0.50; [WIP PATCH] Deleting the last frame of an
 emacsclient doesn't ask to save
Date: Thu, 7 Sep 2023 18:21:34 -0700
On 9/7/2023 2:03 PM, Stefan Kangas wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
>> On 11/9/2022 2:06 AM, Robert Pluim wrote:
>>> That sounds good
>> [snip]
>>> as does this
>> [snip]
>>> I think it would be too risky a change.
>>
>> Thanks. I agree with all that.
>>
>> Since there haven't been any further comments in the past week, I've merged just the first patch (to make
>> 'server-mode' (de)activate at the right times) as 0147e1ed831151dddac65727886d5a70bbab9f02.
> 
> This was a long thread.  From skimming it, it's not clear to me if
> there's anything left to do here?

Yeah, I'd say we're done here; I just forgot to close the bug at the 
time. Closing this now.

[Message part 3 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; [WIP PATCH] Deleting the last frame of an emacsclient
 doesn't ask to save
Date: Sun, 30 Oct 2022 15:29:30 -0700
[Message part 4 (text/plain, inline)]
(Note: this is tangentially related to bug#51993, but it happens 
regardless of whether 'server-stop-automatically' is enabled.)

In most cases when you do something to exit an Emacs client, it prompts 
you to save buffers associated with that client. For example:

  $ emacs -Q -f server-start
  $ emacsclient -c foo.txt

  ;; type some random characters

  C-x #
  ;; or...
  C-x C-c

In both cases, Emacs will ask to save foo.txt, though the prompts will 
be slightly different. That's good, since whatever invoked "emacsclient 
-c foo.txt" is likely waiting for the user to have saved that file.

However, if you use 'C-x 5 0' instead, that terminates the Emacs client, 
but *doesn't* prompt to save foo.txt. I think it should prompt in this 
case too: all three of 'C-x #', 'C-x C-c', and 'C-x 5 0' have the effect 
(in this simple case) of deleting the Emacs client and returning to the 
calling process. (A user who wanted to bail out of an Emacs client 
without saving should use 'sever-edit-abort' instead.)

Attached is a WIP patch to do this. It's WIP because it will need to 
have some special handling for the 'server-stop-automatically' case so 
that it doesn't prompt twice in some cases. I also changed how 
'delete-frame' calls 'delete-frame-functions'. Hopefully the change I 
made is correct; I'm hesitant to change low-level code like that, but I 
think it's the right thing to do for this case at least. (Maybe that 
change should be called out in NEWS?)

Ultimately, it might make sense to merge this bug with bug#51993, but 
the discussion in that bug is already pretty long, and I think it would 
just confuse matters to add even more tangents to that discussion.
[0001-When-deleting-the-last-frame-of-an-Emacs-client-ask-.patch (text/plain, attachment)]

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.