[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Recovered file has extra ^M
From: |
MIYOSHI Masanori |
Subject: |
Recovered file has extra ^M |
Date: |
Tue, 15 Aug 2006 23:54:48 +0900 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Meadow-3.00-dev (KIKU) |
In Emacs on Windows, A recovered file has an extra ^M at the end
of each line.
The following inconsistency seems to cause the trouble.
When Emacs writes out an auto-save file, Emacs doesn't set its
eol type explicitly. So CR/LF is selected for it on Windows.
On the contrary, when Emacs reads the auto-save file, Emacs
assumes that its eol type is LF.
Is this assumption necessary?
In choose_write_coding_system()@fileio.c
> if (auto_saving
> && NILP (Fstring_equal (current_buffer->filename,
> current_buffer->auto_save_file_name)))
> {
> /* We use emacs-mule for auto saving... */
> setup_coding_system (Qemacs_mule, coding);
> /* ... but with the special flag to indicate not to strip off
> leading code of eight-bit-control chars. */
> coding->flags = 1;
> goto done_setup_coding;
> }
In Finsert_file_contents()@fileio.c
> if (EQ (Vcoding_system_for_read, Qauto_save_coding))
> {
...
> coding.eol_type = CODING_EOL_LF;
...
> }
--
MIYOSHI Masanori