all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Collation tests in fns-tests.el
@ 2015-10-30 17:51 Ken Brown
  2015-10-30 20:28 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Ken Brown @ 2015-10-30 17:51 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs

Hi Michael,

I'm curious why you put the following test in fns-tests.el:

;; Punctuation and whitespace characters are not taken into account
   ;; for collation in other locales.
   (should
    (equal
     (sort '("11" "12" "1 1" "1 2" "1.1" "1.2")
	  (lambda (a b)
	    (let ((w32-collate-ignore-punctuation t))
	      (string-collate-lessp
	       a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8")))))
     '("11" "1 1" "1.1" "12" "1 2" "1.2")))

This suggests that punctuation and whitespace should definitely not be 
taken into account in non-POSIX locales.  But the docstring of 'sort' is 
much less definitive:

"This function obeys the conventions for collation order in your locale 
settings.  For example, punctuation and whitespace characters *might* be 
considered less significant for sorting."  [My emphasis.]

Is there some place where emacs relies on punctuation and whitespace 
being ignored?  That certainly isn't the case on all supported systems, 
nor is it mandated by POSIX.

Ken

P.S. My question is motivated by the fact that punctuation and 
whitespace are not ignored on Cygwin in non-POSIX locales, and it does 
not seem to be easy to make this happen.  If you're interested in the 
gory details, start here:

   https://www.cygwin.com/ml/cygwin/2015-10/msg00516.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-11-02 16:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-30 17:51 Collation tests in fns-tests.el Ken Brown
2015-10-30 20:28 ` Eli Zaretskii
2015-10-30 20:40   ` Eli Zaretskii
2015-10-30 21:10   ` Ken Brown
2015-10-30 21:35     ` Eli Zaretskii
2015-10-30 22:16       ` Ken Brown
2015-10-31  8:49         ` Michael Albinus
2015-10-31  9:07           ` Eli Zaretskii
2015-11-02 16:25             ` Ken Brown

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.