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: Setting file-name/process coding system from LANG Date: Wed, 13 Oct 2004 17:44:16 +0900 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: 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 1097657119 4282 80.91.229.6 (13 Oct 2004 08:45:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Oct 2004 08:45:19 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 13 10:45:13 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 1CHekz-0004Mo-00 for ; Wed, 13 Oct 2004 10:45:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CHes0-0000Oc-UE for ged-emacs-devel@m.gmane.org; Wed, 13 Oct 2004 04:52:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CHerP-0000NU-83 for emacs-devel@gnu.org; Wed, 13 Oct 2004 04:51:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CHerI-0000MR-M3 for emacs-devel@gnu.org; Wed, 13 Oct 2004 04:51:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CHerH-0000MJ-Vv for emacs-devel@gnu.org; Wed, 13 Oct 2004 04:51:44 -0400 Original-Received: from [202.32.8.214] (helo=tyo201.gate.nec.co.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CHekC-0005pH-Ou; Wed, 13 Oct 2004 04:44:25 -0400 Original-Received: from mailgate4.nec.co.jp (mailgate54.nec.co.jp [10.7.69.193]) by tyo201.gate.nec.co.jp (8.11.7/3.7W01080315) with ESMTP id i9D8iMA16021; Wed, 13 Oct 2004 17:44:22 +0900 (JST) Original-Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id i9D8iMb25436; Wed, 13 Oct 2004 17:44:22 +0900 (JST) Original-Received: from edtmg04.lsi.nec.co.jp ([10.26.17.201]) by mailsv4.nec.co.jp (8.11.7/3.7W-MAILSV4-NEC) with ESMTP id i9D8iLN13826; Wed, 13 Oct 2004 17:44:21 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp (localhost [127.0.0.1]) by edtmg04.lsi.nec.co.jp (8.12.10/8.12.10) with ESMTP id i9D8iHiJ008629; Wed, 13 Oct 2004 17:44:21 +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 i9D8iGwt019531; Wed, 13 Oct 2004 17:44:16 +0900 (JST) Original-Received: by mctpc71 (Postfix, from userid 31295) id 8AED14A6; Wed, 13 Oct 2004 17:44:16 +0900 (JST) Original-To: emacs-devel@gnu.org System-Type: i686-pc-linux-gnu Blat: Foop Original-Lines: 37 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:28343 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28343 I use "Japanese" language environment, and my LANG environment variable is set to "ja_JP.UTF-8". It seems to me that LANG should be enough to force filenames and process I/O coding to use utf-8, regardless of the Emacs language-environment setting -- after all, the language-environment is more of a broad hint how to operate, whereas LANG can say specifically what coding system to use, and will cause subprocesses to do their I/O in that coding system -- but this doesn't seem to happen. If I start emacs with -q, it will set things up correctly from LANG (so for instance, starting a shell and do a ls will show utf-8 encoded filenames correctly). However, as soon as I do `M-x set-language-environment RET Japanese RET', then default-file-name-coding-system gets set to `japanese-iso-8bit', and the default coding system for process I/O is also `japanese-iso-8bit', which is wrong. I use the following code in my .emacs: (when (and (getenv "LANG") (string-match "\\