[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recovered file has extra ^M

From: Kenichi Handa
Subject: Re: Recovered file has extra ^M
Date: Wed, 16 Aug 2006 14:18:29 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Eli Zaretskii <address@hidden> writes:

> > I think we should change auto-saving to force LF because
> > auto-saving must be fast.  So, I changed
> > choose_write_coding_system, not Finsert_file_contents.

> Suppose I was editing a file whose EOL conversion is -dos, and killed
> Emacs without saving my edits--what will be the EOL conversion of the
> buffer visiting that file after I recover-file in the new session?

Same as that of the original file.  What recover-file does
is roughly this (provided that your file is "temp").

(let (coding-system)
  (switch-to-buffer (find-file-noselect "temp"))
  (setq coding-system buffer-file-coding-system)
  (let ((coding-system-for-read 'auto-save-coding))
    (insert-file-contents "#temp#"))
  (set-buffer-file-coding-system coding-system))

So, if the correct encoding can be detected from "temp",
Emacs wins.

Kenichi Handa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]