Subject: bug#13522: 24.2; save-buffer removes edited file under some conditions

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 15 Mar 2022 12:42:37 +0100

Eli Zaretskii <[email-masked]> writes:

>> And, yes, we make no guarantees, but the present situation doesn't seem
>> optimal.  The user may well hit `C-z' at the prompt and wonder where the
>> file disappeared to.
>
> That's in the "if it hurts, don't do that" department, IMO.  SIGINT is
> a fatal signal, and our response to fatal signals cannot be too
> fancy.  We just auto-save what we can and commit suicide.  Even that
> is disliked by some, who say we cannot safely do anything non-trivial
> from a fatal signal handler -- and they are absolutely right, we do
> stuff that invokes undefined behavior.

I agree that killing Emacs is unusual.  But suspending Emacs (with
`C-z') is something people do all the time, and in this case, if the
user is suspending Emacs on this prompt, they might be doing that to
examine the file before saving it, for instance.  And then they'll be
confused that it's apparently gone.

So I think we should fix this, perhaps the way Glenn suggested in his
patch, but it's obviously not high priority.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no