emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Recovered file has extra ^M


From: Eli Zaretskii
Subject: Re: Recovered file has extra ^M
Date: Wed, 16 Aug 2006 22:55:21 +0300

> From: Kenichi Handa <address@hidden>
> CC: address@hidden
> Date: Wed, 16 Aug 2006 14:18:29 +0900
> 
> (let (coding-system)
>   (switch-to-buffer (find-file-noselect "temp"))
>   (setq coding-system buffer-file-coding-system)
>   (erase-buffer)
>   (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.

I'm not sure I understand what did you mean by ``if the correct
encoding can be detected from "temp"''.  Does it mean that only the
file name and perhaps its contents before the editing are used in the
usual way to determine or detect its EOL format?  If so, then the
following scenario will lose:

    C-x C-f temp RET
    C-x RET f dos
    ... edit the file's text ...
    M-x do-auto-save RET
    C-x C-c

If after this, you recover-file, and the original file "temp" had EOL
format other than -dos, then the recovered file will not have the -dos
EOL format.  Am I missing something?




reply via email to

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