From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Setting file-name/process coding system from LANG Date: Wed, 20 Oct 2004 17:50:40 +0900 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200410181304.WAA24091@etlken.m17n.org> <200410191313.WAA27071@etlken.m17n.org> <20041019215111.GA9395@fencepost> <200410200621.PAA29245@etlken.m17n.org> Reply-To: Miles Bader NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098262367 19652 80.91.229.6 (20 Oct 2004 08:52:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2004 08:52:47 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 20 10:52:32 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CKCCu-0002I1-00 for ; Wed, 20 Oct 2004 10:52:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKCKH-000370-0N for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2004 05:00:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CKCJL-00034g-SK for emacs-devel@gnu.org; Wed, 20 Oct 2004 04:59:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CKCJH-00034B-6I for emacs-devel@gnu.org; Wed, 20 Oct 2004 04:59:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CKCJG-00033m-Kg for emacs-devel@gnu.org; Wed, 20 Oct 2004 04:59:06 -0400 Original-Received: from [202.32.8.202] (helo=tyo202.gate.nec.co.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CKCBH-0007Bo-Bc; Wed, 20 Oct 2004 04:50:51 -0400 Original-Received: from mailgate4.nec.co.jp (mailgate54.nec.co.jp [10.7.69.195]) by tyo202.gate.nec.co.jp (8.11.7/3.7W01080315) with ESMTP id i9K8ohn02231; Wed, 20 Oct 2004 17:50:43 +0900 (JST) Original-Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id i9K8ohp29350; Wed, 20 Oct 2004 17:50:43 +0900 (JST) Original-Received: from edtmg01.lsi.nec.co.jp ([10.26.16.201]) by mailsv.nec.co.jp (8.11.7/3.7W-MAILSV-NEC) with ESMTP id i9K8ogx06611; Wed, 20 Oct 2004 17:50:42 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp (localhost [127.0.0.1]) by edtmg01.lsi.nec.co.jp (8.12.10/8.12.10) with ESMTP id i9K8ofaD010354; Wed, 20 Oct 2004 17:50:41 +0900 (JST) Original-Received: from mctpc71 (mctpc71.ucom.lsi.nec.co.jp [10.30.118.121]) by mcsss2.ucom.lsi.nec.co.jp (8.12.10/8.12.8/EDcg v2.01-mc/1046780839) with ESMTP id i9K8oewt003889; Wed, 20 Oct 2004 17:50:40 +0900 (JST) Original-Received: by mctpc71 (Postfix, from userid 31295) id 937353C0; Wed, 20 Oct 2004 17:50:40 +0900 (JST) Original-To: Kenichi Handa System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <200410200621.PAA29245@etlken.m17n.org> (Kenichi Handa's message of "Wed, 20 Oct 2004 15:21:54 +0900 (JST)") Original-Lines: 83 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28648 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28648 Kenichi Handa 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.