Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation.

From: Paul Eggert <[email-masked]>
Date: Wed, 27 Aug 2014 14:27:50 -0700

Eli Zaretskii wrote:

> I think we agreed to have a variable that holds the non-default locale
> as a Lisp string.

Ah, sorry, missed that (it is a long thread...).  Makes sense.  I assume 
this is on someone's TODO list since it's not done that way now.

> Perhaps binding a variable to the object will do.

We could do both: i.e., give the comparison function an optional 
argument that defaults to the value of the bound variable.  I'd think 
the value should be a locale object, though, not a string like "en_US". 
  And perhaps the object should also record whether the comparison is 
case-sensitive, and other stuff like that.

> Alternatively, a simple one-slot cache internal to string_collate will
> probably remove most of the overhead.

It would now, but it would also add another obstacle to adding 
multithreading capabilities, as the locking around the cache would 
inhibit scalability.  So I'd rather avoid such a cache if it's easy.