(find-file FILE CODESYS) doesn't set `buffer-file-coding-system' if
FILE is a newly created file. I.e.
C-u C-x C-f bar RET euc-jp RET
will not set `buffer-file-coding-system' to EUC-JP if "bar" is a file
which doesn't exist yet but is newly created. See the following example:
mfabian@gregory:~/xemacs-bug$ ls
mfabian@gregory:~/xemacs-bug$ touch foo
mfabian@gregory:~/xemacs-bug$ ls
foo
mfabian@gregory:~/xemacs-bug$ xemacs -q -vanilla -batch --eval "(progn (find-file
\"foo\" 'euc-jp) (message \"%s\"
buffer-file-coding-system))"
#<coding_system euc-jp-unix>
mfabian@gregory:~/xemacs-bug$ xemacs -q -vanilla -batch --eval "(progn (find-file
\"bar\" 'euc-jp) (message \"%s\"
buffer-file-coding-system))"
iso-2022-jp
mfabian@gregory:~/xemacs-bug$
I.e. when the existing (but empty) file "foo" was visited,
buffer-file-coding-system did get set, but when the not yet existing
file "bar" was visited, buffer-file-coding-system did not get set.
I did the above test in the following locale:
mfabian@gregory:~/xemacs-bug$ locale
LANG=ja_JP
LC_CTYPE="ja_JP"
LC_NUMERIC="ja_JP"
LC_TIME="ja_JP"
LC_COLLATE=POSIX
LC_MONETARY="ja_JP"
LC_MESSAGES="ja_JP"
LC_PAPER="ja_JP"
LC_NAME="ja_JP"
LC_ADDRESS="ja_JP"
LC_TELEPHONE="ja_JP"
LC_MEASUREMENT="ja_JP"
LC_IDENTIFICATION="ja_JP"
LC_ALL=
mfabian@gregory:~/xemacs-bug$
--
Mike Fabian <mfabian(a)suse.de>
http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。