[Top][All Lists]

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

Re: Changed character set in file is not picked up

From: Stefan Monnier
Subject: Re: Changed character set in file is not picked up
Date: Thu, 03 Apr 2008 18:32:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> At the same time, the file was loaded into a buffer in Emacs. That is,
> I converted the file in the shell while it was in a buffer in
> Emacs. I forgot to delete the buffer when converting the file. Just to make
> sure that everything was allright, I visited the same file with the same
> file name into the same buffer. The minibuffer said "File file.txt changed
> on disk. Reread from disk? (yes or no) ". The file was loaded, but Emacs did
> not pick up the changed encoding. So I saw a lot of numeric codes prefixed
> with backslash.

Yes, I think you're right.  IIRC one of the reasons not to try and
re-detect the encoding is that the user may have specified a particular
encoding explicitly (in case the auto-detection doesn't work right), in
which case we want to preserve it.

But in that case we should remember that the coding system in use was
not automatically set but explicitly set by the user.  There are a few
other places where we need to make such distinctions.  E.g. if the user
does a C-x RET f to set the buffer-file-coding-system, Emacs should not
silently choose another coding-system upon save, even though it
currently does just that.


reply via email to

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