Corrected: Emacs unexpectedly deletes edited file

John J. Xenakis <[email protected]>
Newsgroups gmane.emacs.windows
Message-ID <[email protected]>
The core problem that Emacs unexpectedly deletes file is still true,
but the sequence for getting the error was incorrect.

I apparently opened the file with the default coding system.  When
I "describe-current-coding-system", I get

Coding system for saving this buffer:
  * -- windows-1252-dos (alias: cp1252-dos)

However, if I open the file with
        (setq  save-buffer-coding-system 'windows-1252) ;; windows only

then I don't get the error message buffer when I save.  I remember now
that I put in the "setq save-buffer-coding-system" long ago precisely
to avoid the error message.

To make this easier to check out, I've saved a small text file that
generates the problem:

http://GenerationalDynamics.com/gdgraphics/emacsproblem.txt

Then if you want to have some fun, try the following:

1. Start Emacs.

2. Open emacsproblem.txt with default coding system.

3. Modify file and save it.

4. Get error message buffer, save as raw text.

5. Close emacs.

Then repeat steps 1-5 over and over.  Each time the file is saved, the
file gets longer and longer, as the string of UTC characters gets
longer and longer.  I don't know, but my guess is that this is a
feature not a bug.  This character encoding stuff really drives me
crazy.

John

-------------------

***** Old message:

1. Open file, setting coding system as follows:
        (setq  save-buffer-coding-system 'windows-1252) ;; windows only

2. Load a file containing \235 character.

3. Modify file and type Ctrl-X Ctrl-S.

4. Get error message buffer that begins: "These default coding systems 
   were tried to encode text ..."

5. Get minibuffer message: "Select coding system (default raw-text): "

6. Decide you don't want to save, click "X" to close emacs.

7. Discover that the entire file has been deleted (though a recovery
   file was saved).

John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.