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

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 14 Mar 2022 12:21:33 +0100

Vincent Lefevre <[email-masked]> writes:

> 1. Create a file with: printf "\x80" > file
> 2. Open the file under X Window with: emacs -Q file
> 3. Modify the file e.g. by adding a space.
> 4. Type C-x C-s
>    At this point, Emacs asks the user to select a coding system.
> 5. Type C-c in the terminal to kill Emacs.
>
> The result is that the file "file" is no longer there!

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

This problem is still present in Emacs 29 -- the file is moved to the
backup file before doing the prompt.

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