From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: per-buffer language environments Date: Mon, 13 Dec 2010 13:47:31 +0200 Message-ID: <838vztj3n0.fsf@gnu.org> References: <20101211.162503.37993912.wl@gnu.org> <83sjy4t9s0.fsf@gnu.org> <20101212.072550.527160732.wl@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1292240871 14109 80.91.229.12 (13 Dec 2010 11:47:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2010 11:47:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 13 12:47:47 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PS6sc-0004Xa-9v for ged-emacs-devel@m.gmane.org; Mon, 13 Dec 2010 12:47:46 +0100 Original-Received: from localhost ([127.0.0.1]:33443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS6sb-0004Kw-Fh for ged-emacs-devel@m.gmane.org; Mon, 13 Dec 2010 06:47:45 -0500 Original-Received: from [140.186.70.92] (port=41543 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS6sV-0004Kq-VC for emacs-devel@gnu.org; Mon, 13 Dec 2010 06:47:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PS6sU-0007tq-D3 for emacs-devel@gnu.org; Mon, 13 Dec 2010 06:47:39 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:61931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PS6sU-0007tI-6Y; Mon, 13 Dec 2010 06:47:38 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LDD0070051SBC00@a-mtaout22.012.net.il>; Mon, 13 Dec 2010 13:47:36 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.167.122]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LDD007827F61RD0@a-mtaout22.012.net.il>; Mon, 13 Dec 2010 13:47:32 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133645 Archived-At: > From: Kenichi Handa > Cc: eliz@gnu.org, emacs-devel@gnu.org > Date: Mon, 13 Dec 2010 16:56:08 +0900 > > In article <20101212.072550.527160732.wl@gnu.org>, Werner LEMBERG writes: > > > But font selection is just one part of the language environment. Are > > > there any other aspects of the language environment that would make > > > sense to have on per-buffer basis? > > > For CJK language environments, I'm not aware of other aspects, but > > probably Ken'ichi-san knows more. > > * Which input method to turn on by C-\. > > * Which coding system to use on writing when the current > buffer contains a character that can't be encoded by > buffer-file-coding-system. > > * Which coding systems have higher priority when inserting a > file in the current buffer. I could understand how the font selection and the default input method are related to the language, but what do encodings have to do with that? The preferred encoding is generally an attribute of a locale, not of a language. The fact that we mix them is because Emacs had language environments before it had locale environments. It's high time to make the distinction, IMO. The language environment should be derived from the language(s) of the text we are editing, and is internal to Emacs, in the sense that it is defined by internal Emacs logic for its purposes. The locale environment is derived from the environment outside Emacs, and expresses the preferences of the outside world. > * The locale of the program invoked by shell-command-on-region. This is _definitely_ not related to the language. It may be the case that to force an external program DTRT for a certain language, you need to set some LC_* variable in the environment of that program, but that's an implementation detail, IMO.