aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
authorEli Zaretskii2014-08-25 18:55:46 +0300
committerEli Zaretskii2014-08-25 18:55:46 +0300
commit015ea0ffdb4f446e3bd263fe5e42b35aafdf1e5b (patch)
tree0242e9b0aa25996e40802ee33aa6929efc3effae /src/fns.c
parent8661ebaa6c0ef3f9517c5288855657b274c723d6 (diff)
downloademacs-015ea0ffdb4f446e3bd263fe5e42b35aafdf1e5b.tar.gz
emacs-015ea0ffdb4f446e3bd263fe5e42b35aafdf1e5b.zip
Implement locale-sensitive string collation for MS-Windows. (Bug#18051)
src/w32proc.c (get_lcid_callback, get_lcid, w32_compare_strings): New functions. src/w32.h (w32_compare_strings): Add prototype. src/w32.c <g_b_init_compare_string_w>: New global flag. (globals_of_w32): Initialize it. src/sysdep.c (str_collate) [WINDOWSNT]: Implementation for MS-Windows. src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp) [WINDOWSNT]: Call str_collate on MS-Windows. etc/NEWS: Mention that string-collate-* functions are supported on MS-Windows as well.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fns.c b/src/fns.c
index 616b54d193c..2e2acf84b95 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -364,7 +364,7 @@ If the environment variable \"LC_COLLATE\" is set in `process-environment',
364it overrides the setting of your current locale. */) 364it overrides the setting of your current locale. */)
365 (Lisp_Object s1, Lisp_Object s2) 365 (Lisp_Object s1, Lisp_Object s2)
366{ 366{
367#ifdef __STDC_ISO_10646__ 367#if defined __STDC_ISO_10646__ || defined WINDOWSNT
368 /* Check parameters. */ 368 /* Check parameters. */
369 if (SYMBOLP (s1)) 369 if (SYMBOLP (s1))
370 s1 = SYMBOL_NAME (s1); 370 s1 = SYMBOL_NAME (s1);
@@ -375,9 +375,9 @@ it overrides the setting of your current locale. */)
375 375
376 return (str_collate (s1, s2) < 0) ? Qt : Qnil; 376 return (str_collate (s1, s2) < 0) ? Qt : Qnil;
377 377
378#else 378#else /* !__STDC_ISO_10646__, !WINDOWSNT */
379 return Fstring_lessp (s1, s2); 379 return Fstring_lessp (s1, s2);
380#endif /* __STDC_ISO_10646__ */ 380#endif /* !__STDC_ISO_10646__, !WINDOWSNT */
381} 381}
382 382
383DEFUN ("string-collate-equalp", Fstring_collate_equalp, Sstring_collate_equalp, 2, 2, 0, 383DEFUN ("string-collate-equalp", Fstring_collate_equalp, Sstring_collate_equalp, 2, 2, 0,
@@ -401,7 +401,7 @@ If the environment variable \"LC_COLLATE\" is set in `process-environment',
401it overrides the setting of your current locale. */) 401it overrides the setting of your current locale. */)
402 (Lisp_Object s1, Lisp_Object s2) 402 (Lisp_Object s1, Lisp_Object s2)
403{ 403{
404#ifdef __STDC_ISO_10646__ 404#if defined __STDC_ISO_10646__ || defined WINDOWSNT
405 /* Check parameters. */ 405 /* Check parameters. */
406 if (SYMBOLP (s1)) 406 if (SYMBOLP (s1))
407 s1 = SYMBOL_NAME (s1); 407 s1 = SYMBOL_NAME (s1);
@@ -412,9 +412,9 @@ it overrides the setting of your current locale. */)
412 412
413 return (str_collate (s1, s2) == 0) ? Qt : Qnil; 413 return (str_collate (s1, s2) == 0) ? Qt : Qnil;
414 414
415#else 415#else /* !__STDC_ISO_10646__, !WINDOWSNT */
416 return Fstring_equal (s1, s2); 416 return Fstring_equal (s1, s2);
417#endif /* __STDC_ISO_10646__ */ 417#endif /* !__STDC_ISO_10646__, !WINDOWSNT */
418} 418}
419 419
420static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args, 420static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args,