Subject: bug#870: Repeatable instance of bug#870

From: martin rudalics <[email-masked]>
Date: Wed, 07 Jan 2009 16:33:56 +0100

> I installed a fix.  It was a different issue.
 >
 > 2009-01-07  Kenichi Handa  <[email-masked]>
 >
 > 	* fileio.c (Finsert_file_contents): In the case of replace,
 > 	remeber the coding system used for decoding in
 > 	coding_system (Bug#1039).

Thanks for taking care of this.  Your fix solves the problem for me
though I'm not sure whether it fixes the issue raised by Peter:

 > That patch fixes the bug I reported, but it creates a new one: if you
 > change the EOL convention outside of emacs, revert-buffer no longer
 > detects this. To reproduce:
 > printf "hello\r\nworld\r\n" > hello
 > emacs -Q hello &
 > printf "hello\rworld\r" > hello
 > M-x revert-buffer
 > # emacs still sees DOS newlines

In particular, when I visit a file, (1) save it with a different line
ending, (2) change the line ending outside this instance of Emacs, and
(3) revert the buffer, its line ending is the one saved in (1) and not
the one from (2).  But IIUC Emacs 22 didn't handle this either.

martin