From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.help Subject: Re: Autogen in Emacs Shell Date: Fri, 1 May 2015 20:35:11 +0200 Message-ID: References: <83twvzszjv.fsf@gnu.org> <20150501092657.GA19316@tuxteam.de> <20150501150340.GB30776@tuxteam.de> <83sibgqjb3.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1430505355 27652 80.91.229.3 (1 May 2015 18:35:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 May 2015 18:35:55 +0000 (UTC) Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 01 20:35:51 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YoFmw-0002Ko-2G for geh-help-gnu-emacs@m.gmane.org; Fri, 01 May 2015 20:35:50 +0200 Original-Received: from localhost ([::1]:55185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoFmv-0002YS-GO for geh-help-gnu-emacs@m.gmane.org; Fri, 01 May 2015 14:35:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoFmR-0002Y9-E4 for help-gnu-emacs@gnu.org; Fri, 01 May 2015 14:35:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoFmM-0002s6-I6 for help-gnu-emacs@gnu.org; Fri, 01 May 2015 14:35:19 -0400 Original-Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:36423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoFmK-0002pE-Im; Fri, 01 May 2015 14:35:12 -0400 Original-Received: by lagv1 with SMTP id v1so69053601lag.3; Fri, 01 May 2015 11:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zyjAe+tC8Y0jh6O0pPQ+xn7HhH88Dg9L75WDgOl7qQo=; b=bCj3SfZXn+1tHCnaufPi5Obnlr0gr+VWjjORX0Zg3FgCA8N99FkUp3w98xXUSKKENA Z9AIydkyJOiH+LJhTKNAg8O41kCZnN9OZzCZ9QnKx23mOuzMl0iYQf6GurKpL591Tq7G UTXHilq8BRCtvgghLXfNmPj2kEPUjpHS1uZsMkp844BVVd1RQcHh31NR2tpl9AMxDpFo cpkQQpiIvRk0p5Ab+kIiaFA8n3AY4ihkE7sAVfUt8BDKpg9KQBelQQM6Y/cj2FNvOK26 VGiSPe9r1Jq5LfjtWISgf6A4OmZXVniuKSwBlQ3gok2rm7o10FdDZbR6kOji86g4+4wT 4e/w== X-Received: by 10.112.142.232 with SMTP id rz8mr8958880lbb.74.1430505311815; Fri, 01 May 2015 11:35:11 -0700 (PDT) Original-Received: by 10.112.36.103 with HTTP; Fri, 1 May 2015 11:35:11 -0700 (PDT) In-Reply-To: <83sibgqjb3.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::229 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104143 Archived-At: > > > Right, so explicitly doing > > > > (setenv "LANG" "en_US.UTF-8") > > > > solves both problems at once. Interesting... Do you have any comments on > that? > > Maybe clarifications on why this problem occurs? For instance, why > `LANG' is > > properly set in ConEmu, while in Emacs it has value `ENU'? > > Because the Windows locale names are different from Posix locale > names. > > > Where does this even come from? > > From w32.c:init_environment: > > /* Get default locale info and use it for LANG. */ > if (GetLocaleInfo (LOCALE_USER_DEFAULT, > LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, > locale_name, sizeof (locale_name))) > { > for (i = 0; i < N_ENV_VARS; i++) > { > if (strcmp (env_vars[i].name, "LANG") == 0) > { > env_vars[i].def_value = locale_name; > break; > } > } > } > > > Is it OK to do > > > > (setenv "LANG" "en_US.UTF-8") > > Not if you want the rest of locale-specific code in Emacs itself to > work, no. > > Why does a native Windows program such as bsdtar expect a Posix-style > locale spec? It's a bug, IMO. The MS-Windows implementation of > 'setlocale' will not work with Posix locale specs. > > > or there is some other more generic way? > > There's no generic way. Locale names and specifications are not > portable between Posix and non-Posix systems. > > I see. Thanks, Eli. Finally, do you have any comments on the issue with "~/emacs.d/init_bash.sh" that I've described before. Let me introduce another test case briefly. Put # Hello, World! # Hello, World! # Hello, World! into "~/emacs.d/init_bash.sh". Then start 'bash' from Emacs. Here is what I see: 2015.05.01 Friday 20:30:46 Haroogan@G75VW:~ $ 2015.05.01 Friday 20:30:46 Haroogan@G75VW:~ $ 2015.05.01 Friday 20:30:46 Haroogan@G75VW:~ $ 2015.05.01 Friday 20:30:46 Haroogan@G75VW:~ $ Those 3 newlines were really typed into the shell. How come?