diff options
| author | Eli Zaretskii | 2024-08-06 21:20:52 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-08-06 21:20:52 +0300 |
| commit | fb642d9cf546f52a11cdfef479447ce2e8fa3ec8 (patch) | |
| tree | babc0c5ccc30e27190fe997bdca8c4c194fb12c9 | |
| parent | f1e37ae423f3be6224f88a21f30ed40e73a4ce22 (diff) | |
| parent | 4dc9e99349d23f6c7fc43f02d5f1e8c50f473183 (diff) | |
| download | emacs-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.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 45 |
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 |
| 469 | Numbers are compared using @code{<} (@pxref{definition of <}). | 469 | Numbers are compared using @code{<} (@pxref{definition of <}). |
| 470 | @item | 470 | @item |
| 471 | Strings are compared using @code{string<} (@pxref{definition of | 471 | Strings are compared using @code{string-lessp} (@pxref{definition of |
| 472 | string<}) and symbols are compared by comparing their names as strings. | 472 | string-lessp}) and symbols are compared by comparing their names as |
| 473 | strings. | ||
| 473 | @item | 474 | @item |
| 474 | Conses, lists, vectors and records are compared lexicographically. This | 475 | Conses, lists, vectors and records are compared lexicographically. This |
| 475 | means that the two sequences are compared element-wise from left to | 476 | means 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 |
| 506 | This function returns @code{t} if the characters of the two strings | 506 | This function returns @code{t} if the characters of the two strings |
| 507 | match exactly. Symbols are also allowed as arguments, in which case | 507 | match exactly. Symbols are also allowed as arguments, in which case |
| 508 | the symbol names are used. Case is always significant, regardless of | 508 | the 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 | |||
| 513 | the two strings are ignored; use @code{equal-including-properties} if | 513 | the two strings are ignored; use @code{equal-including-properties} if |
| 514 | you need to distinguish between strings that differ only in their text | 514 | you need to distinguish between strings that differ only in their text |
| 515 | properties. However, unlike @code{equal}, if either argument is not a | 515 | properties. However, unlike @code{equal}, if either argument is not a |
| 516 | string or symbol, @code{string=} signals an error. | 516 | string 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 | ||
| 527 | A unibyte and a multibyte string are equal in the sense of | 527 | A 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 |
| 529 | character codes all being in the range 0--127 (@acronym{ASCII}). | 529 | character 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!!) | ||
| 603 | This function compares two strings a character at a time. It | 602 | This function compares two strings a character at a time. It |
| 604 | scans both the strings at the same time to find the first pair of corresponding | 603 | scans both the strings at the same time to find the first pair of corresponding |
| 605 | characters that do not match. If the lesser character of these two is | 604 | characters 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 | |||
| 651 | are compared. | 650 | are 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 |
| 666 | This function returns @code{t} if @var{string1} is less than | 669 | This function returns @code{t} if @var{string1} is less than |