emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CSV parsing and other issues (Re: LC_NUMERIC)


From: Eli Zaretskii
Subject: Re: CSV parsing and other issues (Re: LC_NUMERIC)
Date: Fri, 11 Jun 2021 21:04:51 +0300

> From: Maxim Nikulin <manikulin@gmail.com>
> Date: Fri, 11 Jun 2021 23:58:24 +0700
> Cc: boruch_baum@gmx.com
> 
> On 10/06/2021 23:57, Eli Zaretskii wrote:
>  >> From: Maxim Nikulin Date: Thu, 10 Jun 2021 23:28:59 +0700
>  >
>  > For processing CSV, if there's a need to know whether the
>  > locale uses the comma as a decimal separator, we could
>  > indeed extend locale-info.  But such an extension is almost
>  > trivial and doesn't even touch on the significant problems
>  > in the rest of the discussion.
>  >
> 
> You forgot `setlocale(LC_NUMERIC, "C")', didn't you?

No, I didn't.  Adding a call to setlocale to locale-info, even if we
want to add an argument for the caller to control the locale, is
trivial.

>  > Here's a trivial example:
>  >
>  >     (insert (downcase (buffer-substring POS1 POS2)))
>  >
>  > Contrast with
>  >
>  >     (insert (downcase "FOO"))
> 
> Either `set-text-properties' should be called on "FOO" before passing it 
> to `downcase'

Which property will help here? we don't have such properties.  they
need to be designed and implemented.

> or `locale-downcase' with LOCALE first argument should be 
> added.

How would you implement locale-downcase?  Are you familiar with how
Emacs case tables work?

And even if we had locale-downcase, which locale would you pass to it
in any given use case?

Please note that I'm not saying these issues cannot be solved -- they
can.  I'm saying that designing them requires non-trivial thought,
something we didn't yet do.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]