From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: CSV parsing and other issues (Re: LC_NUMERIC) Date: Thu, 03 Jun 2021 18:01:03 +0300 Message-ID: <83eedjvvps.fsf@gnu.org> References: <20210602185441.nhvhirdffamahgfy@E15-2016.optimum.net> <921965d7-af86-6d2e-8b48-3d0b9b51998e@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13929"; mail-complaints-to="usenet@ciao.gmane.io" Cc: utkarsh190601@gmail.com, emacs-devel@gnu.org To: Maxim Nikulin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 03 17:02:16 2021 Return-path: Envelope-to: ged-emacs-devel@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 1loorP-0003RK-Vy for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Jun 2021 17:02:15 +0200 Original-Received: from localhost ([::1]:38946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loorP-00083N-2o for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Jun 2021 11:02:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1looqS-00072Y-KZ for emacs-devel@gnu.org; Thu, 03 Jun 2021 11:01:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48930) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1looqS-0006S4-6I; Thu, 03 Jun 2021 11:01:16 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4703 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1looqQ-0008QL-Rs; Thu, 03 Jun 2021 11:01:16 -0400 In-Reply-To: <921965d7-af86-6d2e-8b48-3d0b9b51998e@gmail.com> (message from Maxim Nikulin on Thu, 3 Jun 2021 21:44:08 +0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270348 Archived-At: > From: Maxim Nikulin > Date: Thu, 3 Jun 2021 21:44:08 +0700 > Cc: Utkarsh Singh > > So locale-aware number formatting would be a great improvement for > Emacs. On the other hand, it should be implemented with great care to > avoid localized numbers in some cases. Maybe locale argument should be > passed to functions that deal with numbers. Formatting of integer > numbers is not enough, floating point numbers should be handled as well. > Parsing numbers formatted accordingly to locale rules should be > addressed too. A function similar to `locale-info' is highly desired to > get properties of locale (e.g. decimal_point from result of localeconv). > Some decision is required whether calc & Co should operate with > localized numbers. Setting a locale globally in Emacs is a non-starter, for the reasons that you point out and others. Text processing in Emacs is generally separate from the current locale's rules, mainly to have Emacs work the same in any locale. So passing a locale argument to functions that produce output, with the intent to request some behavior to be tailored to that locale, is the only reasonable way to have this kind of functionalities in Emacs. The problem with that, of course, is that not every supported platform can dynamically change the locale, let alone do that efficiently.