From: Miles Bader <miles@lsi.nec.co.jp>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Setting file-name/process coding system from LANG
Date: Wed, 20 Oct 2004 17:50:40 +0900 [thread overview]
Message-ID: <buooeix93j3.fsf@mctpc71.ucom.lsi.nec.co.jp> (raw)
In-Reply-To: <200410200621.PAA29245@etlken.m17n.org> (Kenichi Handa's message of "Wed, 20 Oct 2004 15:21:54 +0900 (JST)")
Kenichi Handa <handa@m17n.org> writes:
>>> Then a user can't recover that original setting when he once
>>> switch to, e.g., Latin-1. Just switching back to Japanese
>>> can't setup coding systems for utf8.
>
>> Why can't we do what I suggested earlier, and set `file-name-coding-system'
>> (and presumably some analogue for process I/O and terminal-coding-system)
>> instead of `default-file-name-coding-system' from the "utf8" portion of LANG?
>
> If it always sets file-name-coding-system, there's no need
> of having default-file-name-coding-system.
Sure there is: it gives set-language-environment something to set.
In other words, the setting established by set-language-environment is a
_default_, but the setting established by LANG (or by the user
explicitly, if uses `C-x C-m whatever') is `real'.
> And, that means that even if one changes to latin-1 lang. env.,
> file-name-coding-system is still utf-8. Is it ok?
I'm not sure; it could be. LANG primarily seems to describe the way
programs should interact with other programs and the user, but
`language-environment' seems a bit more vague.
A user might very well change the language-environment to get various
customizations for his own typical usage -- LEIM input system, tutorial
language, file-coding priorities -- but he's still using the same
system, his terminal hasn't changed, etc.
If we assume that LANG was set correctly for this system (it describes
the way typical tools work), then it seems reasonable for emacs to
continue interacting with the system in the same way even if the user
changes the language-environment.
However if the user uses `set-language-environment' because LANG wasn't
set, or because it was set incorrectly, he probably wants it to override
everything.
Which of these scenarios is more common? I'm not sure, but it doesn't
seem unreasonable to assume that _if_ LANG contains an explicit coding
system, that it's "correct".
[BTW, another thing: if set-language-environment _does_ change the
process-related coding systems, it probably also ought to change the
value of LANG that subprocesses get, so at least it's _consistent_...]
>>> Another problem is the case of LANG=zh_CN.utf8. Currently
>>> we don't have Chinese lang. env. We only have Chinese-GB,
>>> Chinese-EUC-TW, Chinese-BIG5, Chinese-CNS. Which one to
>>> use?
>
>> Presumably whichever one best matches the "country" portion of LANG.
>
> % locale -a|grep zh
> shows these:
>
> zh_CN
> zh_CN.gb18030
> zh_CN.gb2312
> zh_CN.gbk
> zh_CN.utf8
> zh_HK
> zh_HK.big5hkscs
> zh_HK.utf8
> zh_SG
> zh_SG.gb2312
> zh_SG.gbk
> zh_TW
> zh_TW.big5
> zh_TW.euctw
> zh_TW.utf8
Well you could just choose whichever is most popular in each country...
[perhaps have an alist do mapping from "chinese country" to "chinese
lang. env." -- by default it would be sorted by popularity, but a user
could change it if he didn't like that... or just set the language
environment explicitly.]
-Miles
--
Yo mama's so fat when she gets on an elevator it HAS to go down.
next prev parent reply other threads:[~2004-10-20 8:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-13 8:44 Setting file-name/process coding system from LANG Miles Bader
2004-10-15 0:25 ` Richard Stallman
2004-10-15 0:51 ` Miles Bader
2004-10-16 13:53 ` Richard Stallman
2004-10-17 0:14 ` Miles Bader
2004-10-25 13:13 ` Richard Stallman
2004-10-18 13:04 ` Kenichi Handa
2004-10-19 6:13 ` Richard Stallman
2004-10-19 13:13 ` Kenichi Handa
2004-10-19 13:51 ` Stefan Monnier
2004-10-20 6:02 ` Kenichi Handa
2004-10-20 10:34 ` Richard Stallman
2004-10-19 21:51 ` Miles Bader
2004-10-20 6:21 ` Kenichi Handa
2004-10-20 8:50 ` Miles Bader [this message]
2004-10-20 13:02 ` Stefan Monnier
2004-10-20 10:34 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=buooeix93j3.fsf@mctpc71.ucom.lsi.nec.co.jp \
--to=miles@lsi.nec.co.jp \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.