From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#51321: 29.0.50; date in modelines Date: Sat, 23 Oct 2021 14:52:14 +0200 Message-ID: References: <83sfwu8g9s.fsf@gnu.org> <05BFC277-0845-40E6-B10C-4582B9BCAB82@algon.dk> <83a6j28cnu.fsf@gnu.org> <13198AFD-F4C9-4DF3-91FF-4D71248DFAF4@algon.dk> <83sfwt7el8.fsf@gnu.org> <6C80587E-2E20-43AB-9B1E-15936BDB0797@algon.dk> <83cznx6teq.fsf@gnu.org> <837de453qg.fsf@gnu.org> Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27164"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) Cc: nisoni@algon.dk, 51321@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 23 14:53:30 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meGWf-0006qy-Tb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 14:53:30 +0200 Original-Received: from localhost ([::1]:48150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meGWe-0002a0-JL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 08:53:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meGWE-0002Zo-59 for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 08:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meGWD-00038m-Tj for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 08:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meGWD-0000bb-PH for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 08:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Oct 2021 12:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51321 X-GNU-PR-Package: emacs Original-Received: via spool by 51321-submit@debbugs.gnu.org id=B51321.16349935482287 (code B ref 51321); Sat, 23 Oct 2021 12:53:01 +0000 Original-Received: (at 51321) by debbugs.gnu.org; 23 Oct 2021 12:52:28 +0000 Original-Received: from localhost ([127.0.0.1]:34639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meGVg-0000ap-9a for submit@debbugs.gnu.org; Sat, 23 Oct 2021 08:52:28 -0400 Original-Received: from sonic306-19.consmr.mail.ir2.yahoo.com ([77.238.176.205]:43170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meGVb-0000aY-FP for 51321@debbugs.gnu.org; Sat, 23 Oct 2021 08:52:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1634993537; bh=2CzLempMxsxhEskYAZ7hxaSZUA4qrvftR5E6+GF+bQI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=NR5dGs2wGAec6z6bCxhCG32xdklkddi4FcLAOB69fnLFfI3MXCH2Yz41/2WV6F2E/3xvDy6aR5/58iylnM8xK8CNAFSvAZdjcgkKk9ibG+rVcIWXKbPzA2Q2JLX3gZfkV/wKlLubrghWqdXpKD7kpGaVUgiMS9xHpz9Vc162NtsQaXk0Kpz3qgxm8yTpFAzH3jSWnTEQ/M9lXOl5r55tnCK89pzTYqhS0U5HkBJUEmQGN+OWWZEKXXxzxmimXSR1kVQdPyjVVU+DdZVpVhLNxj/pKESi8KsbLZRfjp+Xtu4BGzLqjNgjv3UG/mlewLFQD1Qgbi4RQzbXWEEVq/6gag== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634993537; bh=CQ0YFr5p7pBdawFG9XGCttmqSe0Tcp/4jqu7jdVvNTD=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ZfDYAciU38PbBmL8c41cohLxkcmnaNBg3WQPURrqwA5w9ZmEs972hlqP1q0Vc09icB8pQg69gjCn3iZuYMQdJUCIX/r2f1zD7q15OyHUpXZKA3RlzwsFEMfidmNKwuE6xmSnSwx7fydNNB7bKBIIEu9yOJAedwrM+ShL7Cgp8QBw/mE6CZumnaZE1JkX7UpmIbFGCGNS3A7/8WcLlVXGhEarDMmviLGfGjWMKP19pl98LXgFSc1g53vSFTU0nHUOESVS11+fivgP0hNLWdeJj560q250RVjjOsiqlgk0JWVoi5sg+dVJ9nNxLZwbBUFBQPsWCajBLxavce7hwC8arw== X-YMail-OSG: 2m.A7D0VM1kJqP.zKQ9CM6kJwCs29wmmxZTTEKGxPGVWo_L95VDcgHMS8HVsT9Q AQ2lq9zJlX2.UTy2nerqZjvOq83xBzQ9.ObB8wjWpNUMehQZp2ZTw.2MUc8AaLm3yRfkS8w9jFDx klzFkBkBp909MbZ4GS4q_FGN.QLjkbuGj7ubSxwyZ4tjwBIQifh_tq8LIg5lAZqRW1oX7XtyJULX mpFE87fWK16gCrTTnPM107arSp2Lqeu67yhPBgMWHRxnvGLP1tgUQHL2zrNmd1OkomuUUvnYM_za Y571Q4etVnv_6_YCeqo2Zo21z80kGWFHmmd.U7fNjb587M3fClk97W3zGk6n97S9FKkVe8_1.tqY kQfoKh6K5XzAiMFC0D1s4DzxOB9_ftmS2ZoxubLRdR62BFnAwhqzHLkj.tioMVBc9i08BiSNsXxn CR4wMIvQlfTGhJepUzQoigeaVLw_lt1rNoOpWACQ_.T5.4cKUg44zSTSfSz3CEn88R56ybshV_TN qHTN4m.BTkJRejpW7b63Fd8rC3vK8HNmVWJcK5suxO4rMF7zSLmoyMQWhz8CKa2kLkO8bjGop044 AZ22ExNEyCiZrNn6zD.S1t6nMFfqLMD4LTgHV8ENGxfzvmUwuCteT.HaK8DwyK5sTI6t4eJ2Vz_J DrvDnUKRfM55H2sYT3JBfivqkjc3mWDvC76J1Y4o6cfns_urfl.dJmtWQ2Hp1fOtndeu56gViy5N YgQ6yZxvmcFZVpiHTWR17u8asvdHMPj3Bcb3gFhkkMkcyf5JvAdgYNzFz8AEKDWgYOsg2F96h0Xr fI13FpFxN9ldEBHapA1yvxrHxegpcxOP55fbWvHcTA X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Sat, 23 Oct 2021 12:52:17 +0000 Original-Received: by kubenode516.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID de1ca2a5c1e0d611d3157f1d57b3dcaf; Sat, 23 Oct 2021 12:52:15 +0000 (UTC) In-Reply-To: <837de453qg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Oct 2021 15:23:52 +0300") X-Mailer: WebService/1.1.19198 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217983 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> >> It depends on how you start Emacs. The common case on macOS is that >> people start Emacs from the GUI, and in that case the OS doesn't >> configure the locale environment variables. What the NS port does is it >> uses the OS API to get the locale and applies the environment variables >> manually (see ns_init_locale in nsterm.m). > > Thanks, I think that explains the issue. > >> I see that ns_init_locale only sets LANG, which seems insufficient for >> this use case. Perhaps we need to extend ns_init_locale to set other >> LC_ variables as well (LC_TIME is the key here). > > Why not LC_ALL? Yes, after consulting the POSIX spec, I think setting LC_ALL is the right thing to do. I've attached a patch that solves the issue. If you think it's a good idea, please install it for me. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Set-LC_ALL-to-the-current-locale-in-the-NS-port.patch >From 472bcdb74139ae53c0c224262c072c462a6f243d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 23 Oct 2021 14:44:31 +0200 Subject: [PATCH] Set LC_ALL to the current locale in the NS port * src/nsterm.m (ns_init_locale): If not already set, set LC_ALL to the current locale ID so that dates, currencies, etc. use the settings configured in the operating system. (Bug#51321) --- src/nsterm.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index aa29c13eb2..e27a025035 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -543,8 +543,10 @@ - (NSColor *)colorUsingDefaultColorSpace NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8", [locale localeIdentifier]]; - /* Set LANG to locale, but not if LANG is already set. */ + /* Set LANG and LC_ALL to locale, but not if the variables are + already set. */ setenv("LANG", [localeID UTF8String], 0); + setenv("LC_ALL", [localeID UT8String], 0); } @catch (NSException *e) { -- 2.31.0 --=-=-=--