aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-08-06 21:20:52 +0300
committerEli Zaretskii2024-08-06 21:20:52 +0300
commitfb642d9cf546f52a11cdfef479447ce2e8fa3ec8 (patch)
treebabc0c5ccc30e27190fe997bdca8c4c194fb12c9
parentf1e37ae423f3be6224f88a21f30ed40e73a4ce22 (diff)
parent4dc9e99349d23f6c7fc43f02d5f1e8c50f473183 (diff)
downloademacs-fb642d9cf546f52a11cdfef479447ce2e8fa3ec8.tar.gz
emacs-fb642d9cf546f52a11cdfef479447ce2e8fa3ec8.zip
Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/emacs into emacs-30
-rw-r--r--doc/lispref/sequences.texi5
-rw-r--r--doc/lispref/strings.texi45
2 files changed, 27 insertions, 23 deletions
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 9b0a0d74f30..079fc6094c3 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -468,8 +468,9 @@ Specifically:
468@item 468@item
469Numbers are compared using @code{<} (@pxref{definition of <}). 469Numbers are compared using @code{<} (@pxref{definition of <}).
470@item 470@item
471Strings are compared using @code{string<} (@pxref{definition of 471Strings are compared using @code{string-lessp} (@pxref{definition of
472string<}) and symbols are compared by comparing their names as strings. 472string-lessp}) and symbols are compared by comparing their names as
473strings.
473@item 474@item
474Conses, lists, vectors and records are compared lexicographically. This 475Conses, lists, vectors and records are compared lexicographically. This
475means that the two sequences are compared element-wise from left to 476means that the two sequences are compared element-wise from left to
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index d29665ac19b..09ab93ded27 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -502,7 +502,7 @@ in case if @code{case-fold-search} is non-@code{nil}.
502@end example 502@end example
503@end defun 503@end defun
504 504
505@defun string= string1 string2 505@defun string-equal string1 string2
506This function returns @code{t} if the characters of the two strings 506This function returns @code{t} if the characters of the two strings
507match exactly. Symbols are also allowed as arguments, in which case 507match exactly. Symbols are also allowed as arguments, in which case
508the symbol names are used. Case is always significant, regardless of 508the symbol names are used. Case is always significant, regardless of
@@ -513,25 +513,25 @@ This function is equivalent to @code{equal} for comparing two strings
513the two strings are ignored; use @code{equal-including-properties} if 513the two strings are ignored; use @code{equal-including-properties} if
514you need to distinguish between strings that differ only in their text 514you need to distinguish between strings that differ only in their text
515properties. However, unlike @code{equal}, if either argument is not a 515properties. However, unlike @code{equal}, if either argument is not a
516string or symbol, @code{string=} signals an error. 516string or symbol, @code{string-equal} signals an error.
517 517
518@example 518@example
519(string= "abc" "abc") 519(string-equal "abc" "abc")
520 @result{} t 520 @result{} t
521(string= "abc" "ABC") 521(string-equal "abc" "ABC")
522 @result{} nil 522 @result{} nil
523(string= "ab" "ABC") 523(string-equal "ab" "ABC")
524 @result{} nil 524 @result{} nil
525@end example 525@end example
526 526
527A unibyte and a multibyte string are equal in the sense of 527A unibyte and a multibyte string are equal in the sense of
528@code{string=} if and only if they contain the same sequence of 528@code{string-equal} if and only if they contain the same sequence of
529character codes all being in the range 0--127 (@acronym{ASCII}). 529character codes all being in the range 0--127 (@acronym{ASCII}).
530@xref{Text Representations}. 530@xref{Text Representations}.
531@end defun 531@end defun
532 532
533@defun string-equal string1 string2 533@defun string= string1 string2
534@code{string-equal} is another name for @code{string=}. 534@code{string=} is another name for @code{string-equal}.
535@end defun 535@end defun
536 536
537@defun string-equal-ignore-case string1 string2 537@defun string-equal-ignore-case string1 string2
@@ -597,9 +597,8 @@ that collation implements.
597@end defun 597@end defun
598 598
599@cindex lexical comparison of strings 599@cindex lexical comparison of strings
600@anchor{definition of string<} 600@anchor{definition of string-lessp}
601@defun string< string1 string2 601@defun string-lessp string1 string2
602@c (findex string< causes problems for permuted index!!)
603This function compares two strings a character at a time. It 602This function compares two strings a character at a time. It
604scans both the strings at the same time to find the first pair of corresponding 603scans both the strings at the same time to find the first pair of corresponding
605characters that do not match. If the lesser character of these two is 604characters that do not match. If the lesser character of these two is
@@ -618,11 +617,11 @@ multibyte non-@acronym{ASCII} character (@pxref{Text Representations}).
618 617
619@example 618@example
620@group 619@group
621(string< "abc" "abd") 620(string-lessp "abc" "abd")
622 @result{} t 621 @result{} t
623(string< "abd" "abc") 622(string-lessp "abd" "abc")
624 @result{} nil 623 @result{} nil
625(string< "123" "abc") 624(string-lessp "123" "abc")
626 @result{} t 625 @result{} t
627@end group 626@end group
628@end example 627@end example
@@ -634,15 +633,15 @@ no characters is less than any other string.
634 633
635@example 634@example
636@group 635@group
637(string< "" "abc") 636(string-lessp "" "abc")
638 @result{} t 637 @result{} t
639(string< "ab" "abc") 638(string-lessp "ab" "abc")
640 @result{} t 639 @result{} t
641(string< "abc" "") 640(string-lessp "abc" "")
642 @result{} nil 641 @result{} nil
643(string< "abc" "ab") 642(string-lessp "abc" "ab")
644 @result{} nil 643 @result{} nil
645(string< "" "") 644(string-lessp "" "")
646 @result{} nil 645 @result{} nil
647@end group 646@end group
648@end example 647@end example
@@ -651,8 +650,8 @@ Symbols are also allowed as arguments, in which case their print names
651are compared. 650are compared.
652@end defun 651@end defun
653 652
654@defun string-lessp string1 string2 653@defun string< string1 string2
655@code{string-lessp} is another name for @code{string<}. 654@code{string<} is another name for @code{string-lessp}.
656@end defun 655@end defun
657 656
658@defun string-greaterp string1 string2 657@defun string-greaterp string1 string2
@@ -661,6 +660,10 @@ This function returns the result of comparing @var{string1} and
661@code{(string-lessp @var{string2} @var{string1})}. 660@code{(string-lessp @var{string2} @var{string1})}.
662@end defun 661@end defun
663 662
663@defun string> string1 string2
664@code{string>} is another name for @code{string-greaterp}.
665@end defun
666
664@cindex locale-dependent string comparison 667@cindex locale-dependent string comparison
665@defun string-collate-lessp string1 string2 &optional locale ignore-case 668@defun string-collate-lessp string1 string2 &optional locale ignore-case
666This function returns @code{t} if @var{string1} is less than 669This function returns @code{t} if @var{string1} is less than