aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2015-11-29 19:52:16 +0200
committerEli Zaretskii2015-11-29 19:52:16 +0200
commit36255fba58b6c73fcf1c810877cc128091fa2a68 (patch)
tree425398ceaa2701c4d010b77dd77b1f7c7f51b687
parentf3bd8262a2f5ea104ca0394683098e3c2efe3024 (diff)
downloademacs-36255fba58b6c73fcf1c810877cc128091fa2a68.tar.gz
emacs-36255fba58b6c73fcf1c810877cc128091fa2a68.zip
Improve documentation of string-collate-* functions
* doc/lispref/strings.texi (Text Comparison): Improve wording and indexing of 'string-collate-equalp' and 'string-collate-lessp'. * etc/NEWS: Move the entry of 'string-collate-equalp' and 'string-collate-lessp' to "Lisp Changes" section and mark it as documented.
-rw-r--r--doc/lispref/strings.texi13
-rw-r--r--etc/NEWS37
2 files changed, 28 insertions, 22 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index f8685d9312c..8aa4539bd78 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -465,6 +465,7 @@ Representations}.
465@code{string-equal} is another name for @code{string=}. 465@code{string-equal} is another name for @code{string=}.
466@end defun 466@end defun
467 467
468@cindex locale-dependent string equivalence
468@defun string-collate-equalp string1 string2 &optional locale ignore-case 469@defun string-collate-equalp string1 string2 &optional locale ignore-case
469This function returns @code{t} if @var{string1} and @var{string2} are 470This function returns @code{t} if @var{string1} and @var{string2} are
470equal with respect to collation rules. A collation rule is not only 471equal with respect to collation rules. A collation rule is not only
@@ -493,6 +494,7 @@ systems.
493If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case 494If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case
494before comparing them. 495before comparing them.
495 496
497@vindex w32-collate-ignore-punctuation
496To emulate Unicode-compliant collation on MS-Windows systems, 498To emulate Unicode-compliant collation on MS-Windows systems,
497bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since 499bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since
498the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows. 500the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows.
@@ -518,7 +520,7 @@ optional argument @var{ignore-case} is non-@code{nil}, the comparison
518ignores case differences. 520ignores case differences.
519@end defun 521@end defun
520 522
521@cindex lexical comparison 523@cindex lexical comparison of strings
522@defun string< string1 string2 524@defun string< string1 string2
523@c (findex string< causes problems for permuted index!!) 525@c (findex string< causes problems for permuted index!!)
524This function compares two strings a character at a time. It 526This function compares two strings a character at a time. It
@@ -576,6 +578,7 @@ are used.
576@code{string-lessp} is another name for @code{string<}. 578@code{string-lessp} is another name for @code{string<}.
577@end defun 579@end defun
578 580
581@cindex locale-dependent string comparison
579@defun string-collate-lessp string1 string2 &optional locale ignore-case 582@defun string-collate-lessp string1 string2 &optional locale ignore-case
580This function returns @code{t} if @var{string1} is less than 583This function returns @code{t} if @var{string1} is less than
581@var{string2} in collation order. A collation order is not only 584@var{string2} in collation order. A collation order is not only
@@ -594,15 +597,15 @@ for sorting (@pxref{Sequence Functions}):
594@end group 597@end group
595@end example 598@end example
596 599
597This behavior is system-dependent; punctuation and whitespace are 600This behavior is system-dependent; e.g., punctuation and whitespace
598never ignored on Cygwin, regardless of locale. 601are never ignored on Cygwin, regardless of locale.
599 602
600The optional argument @var{locale}, a string, overrides the setting of 603The optional argument @var{locale}, a string, overrides the setting of
601your current locale identifier for collation. The value is system 604your current locale identifier for collation. The value is system
602dependent; a @var{locale} @code{"en_US.UTF-8"} is applicable on POSIX 605dependent; a @var{locale} @code{"en_US.UTF-8"} is applicable on POSIX
603systems, while it would be, e.g., @code{"enu_USA.1252"} on MS-Windows 606systems, while it would be, e.g., @code{"enu_USA.1252"} on MS-Windows
604systems. The @var{locale} @code{"POSIX"} lets @code{string-collate-lessp} 607systems. The @var{locale} value of @code{"POSIX"} or @code{"C"} lets
605behave like @code{string-lessp}: 608@code{string-collate-lessp} behave like @code{string-lessp}:
606 609
607@example 610@example
608@group 611@group
diff --git a/etc/NEWS b/etc/NEWS
index dc3758f8eb2..180e48ffc36 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -181,23 +181,6 @@ for use in Emacs bug reports.
181hiding character but the default `.' can be used by let-binding the 181hiding character but the default `.' can be used by let-binding the
182variable `read-hide-char'. 182variable `read-hide-char'.
183 183
184** The new functions `string-collate-lessp' and `string-collate-equalp'
185preserve the collation order as defined by the system's locale(1)
186environment. For the time being this is implemented for modern POSIX
187systems and for MS-Windows, for other systems they fall back to their
188counterparts `string-lessp' and `string-equal'.
189
190*** The ls-lisp package uses `string-collate-lessp' to sort file names.
191If you want the old, locale-independent sorting, customize the new
192option `ls-lisp-use-string-collate' to a nil value.
193
194*** The MS-Windows specific variable `w32-collate-ignore-punctuation',
195if set to a non-nil value, causes the above 2 functions to ignore
196symbol and punctuation characters when collating strings. This
197emulates the behavior of modern Posix platforms when the locale's
198codeset is "UTF-8" (as in "en_US.UTF-8"). This is needed because
199MS-Windows doesn't support UTF-8 as codeset in its locales.
200
201+++ 184+++
202** The new function `bidi-find-overridden-directionality' allows to 185** The new function `bidi-find-overridden-directionality' allows to
203find characters whose directionality was, perhaps maliciously, 186find characters whose directionality was, perhaps maliciously,
@@ -1199,6 +1182,26 @@ evaluated (and should return a string) when the closure is built.
1199** New function `string-greaterp', which return the opposite result of 1182** New function `string-greaterp', which return the opposite result of
1200`string-lessp'. 1183`string-lessp'.
1201 1184
1185+++
1186** The new functions `string-collate-lessp' and `string-collate-equalp'
1187preserve the collation order as defined by the system's locale(1)
1188environment. For the time being this is implemented for modern POSIX
1189systems and for MS-Windows, for other systems they fall back to their
1190counterparts `string-lessp' and `string-equal'.
1191
1192---
1193*** The ls-lisp package uses `string-collate-lessp' to sort file names.
1194If you want the old, locale-independent sorting, customize the new
1195option `ls-lisp-use-string-collate' to a nil value.
1196
1197+++
1198*** The MS-Windows specific variable `w32-collate-ignore-punctuation',
1199if set to a non-nil value, causes the above 2 functions to ignore
1200symbol and punctuation characters when collating strings. This
1201emulates the behavior of modern Posix platforms when the locale's
1202codeset is "UTF-8" (as in "en_US.UTF-8"). This is needed because
1203MS-Windows doesn't support UTF-8 as codeset in its locales.
1204
1202** New function `alist-get', which is also a valid place (aka lvalue). 1205** New function `alist-get', which is also a valid place (aka lvalue).
1203 1206
1204** New function `funcall-interactively', which works like `funcall' 1207** New function `funcall-interactively', which works like `funcall'