From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.6) Gecko/20050323 Fedora/1.7.6-1.3.2
Description of problem:
Under a certain very bizarre circumstance, emacs deletes
the file which is being edited when the user tries to
save it with C-x C-s.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Make sure you don't have a $HOME/emacsbug directory and type this in
cat >gen.c << EOF
gcc gen.c -o gen
2. So far we have created a file 'foo', and launched emacs to edit it.
Now in emacs hit exactly the following keys:
RET C-x C-s C-g C-x u C-x C-c
What happens is this: we type RET just to modify the file (so as to be
able to save it with C-x C-s), then we try to save it, then emacs complains
that it cannot be safely converted to any default coding system, then we
change our mind and decide to undo what we've just done, and we exit cleanly.
3. Now emacs has closed, we're back in the terminal. Just type 'ls'.
Actual Results: The file 'foo' has disappeared: emacs has deleted it.
Expected Results: The file 'foo' should still be here, unchanged.
It is very important to execute the above steps as indicated.
I have tried doing this in /tmp/emacsbug rather than $HOME/emacsbug,
and then the bug *doesn't* happen any more !
This bug has been fixed in emacs 22. See
date: 2002/07/23 19:23:08; author: rms; state: Exp; lines: +27 -12
Sorry, here is the diff:
Thanks. However the above patch doesn't apply to emacs 21.