diff options
| author | Chong Yidong | 2012-12-15 21:44:41 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-12-15 21:44:41 +0800 |
| commit | 5bec25eb1e1c91a2fe0aee9c332ff1506b021aa9 (patch) | |
| tree | 245a212c400b5c0d37448f462f09eed8980471b4 | |
| parent | 68abf86780a1b263640e287754dc43526d276aa3 (diff) | |
| download | emacs-5bec25eb1e1c91a2fe0aee9c332ff1506b021aa9.tar.gz emacs-5bec25eb1e1c91a2fe0aee9c332ff1506b021aa9.zip | |
* fns.c (Fcompare_strings): Doc fix.
* strings.texi (Text Comparison): Doc fix for compare-strings.
Fixes: debbugs:13081
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 34 | ||||
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fns.c | 18 |
4 files changed, 39 insertions, 21 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 9dbce599bd1..9aeff403ec3 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-12-15 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * strings.texi (Text Comparison): Doc fix for compare-strings. | ||
| 4 | |||
| 1 | 2012-12-09 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-12-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * control.texi (Pattern matching case statement): New node. | 7 | * control.texi (Pattern matching case statement): New node. |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 865435c91b3..c127cec8f8a 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -517,25 +517,29 @@ comparison ignores case differences. | |||
| 517 | @end defun | 517 | @end defun |
| 518 | 518 | ||
| 519 | @defun compare-strings string1 start1 end1 string2 start2 end2 &optional ignore-case | 519 | @defun compare-strings string1 start1 end1 string2 start2 end2 &optional ignore-case |
| 520 | This function compares the specified part of @var{string1} with the | 520 | This function compares a specified part of @var{string1} with a |
| 521 | specified part of @var{string2}. The specified part of @var{string1} | 521 | specified part of @var{string2}. The specified part of @var{string1} |
| 522 | runs from index @var{start1} up to index @var{end1} (@code{nil} means | 522 | runs from index @var{start1} (inclusive) up to index @var{end1} |
| 523 | the end of the string). The specified part of @var{string2} runs from | 523 | (exclusive); @code{nil} for @var{start1} means the start of the |
| 524 | index @var{start2} up to index @var{end2} (@code{nil} means the end of | 524 | string, while @code{nil} for @var{end1} means the length of the |
| 525 | the string). | 525 | string. Likewise, the specified part of @var{string2} runs from index |
| 526 | 526 | @var{start2} up to index @var{end2}. | |
| 527 | The strings are both converted to multibyte for the comparison | 527 | |
| 528 | (@pxref{Text Representations}) so that a unibyte string and its | 528 | The strings are compared by the numeric values of their characters. |
| 529 | conversion to multibyte are always regarded as equal. If | 529 | For instance, @var{str1} is considered ``smaller than'' @var{str2} if |
| 530 | @var{ignore-case} is non-@code{nil}, then case is ignored, so that | 530 | its first differing character has a smaller numeric value. If |
| 531 | upper case letters can be equal to lower case letters. | 531 | @var{ignore-case} is non-@code{nil}, characters are converted to |
| 532 | lower-case before comparing them. Unibyte strings are converted to | ||
| 533 | multibyte for comparison (@pxref{Text Representations}), so that a | ||
| 534 | unibyte string and its conversion to multibyte are always regarded as | ||
| 535 | equal. | ||
| 532 | 536 | ||
| 533 | If the specified portions of the two strings match, the value is | 537 | If the specified portions of the two strings match, the value is |
| 534 | @code{t}. Otherwise, the value is an integer which indicates how many | 538 | @code{t}. Otherwise, the value is an integer which indicates how many |
| 535 | leading characters agree, and which string is less. Its absolute value | 539 | leading characters agree, and which string is less. Its absolute |
| 536 | is one plus the number of characters that agree at the beginning of the | 540 | value is one plus the number of characters that agree at the beginning |
| 537 | two strings. The sign is negative if @var{string1} (or its specified | 541 | of the two strings. The sign is negative if @var{string1} (or its |
| 538 | portion) is less. | 542 | specified portion) is less. |
| 539 | @end defun | 543 | @end defun |
| 540 | 544 | ||
| 541 | @defun assoc-string key alist &optional case-fold | 545 | @defun assoc-string key alist &optional case-fold |
diff --git a/src/ChangeLog b/src/ChangeLog index fe30528da91..c123606efda 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-12-15 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * fns.c (Fcompare_strings): Doc fix (Bug#13081). | ||
| 4 | |||
| 1 | 2012-12-14 Eli Zaretskii <eliz@gnu.org> | 5 | 2012-12-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * w32.c (get_name_and_id): Always pass NULL as the first argument | 7 | * w32.c (get_name_and_id): Always pass NULL as the first argument |
| @@ -211,12 +211,18 @@ Symbols are also allowed; their print names are used instead. */) | |||
| 211 | 211 | ||
| 212 | DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0, | 212 | DEFUN ("compare-strings", Fcompare_strings, Scompare_strings, 6, 7, 0, |
| 213 | doc: /* Compare the contents of two strings, converting to multibyte if needed. | 213 | doc: /* Compare the contents of two strings, converting to multibyte if needed. |
| 214 | In string STR1, skip the first START1 characters and stop at END1. | 214 | The arguments START1, END1, START2, and END2, if non-nil, are |
| 215 | In string STR2, skip the first START2 characters and stop at END2. | 215 | positions specifying which parts of STR1 or STR2 to compare. In |
| 216 | END1 and END2 default to the full lengths of the respective strings. | 216 | string STR1, compare the part between START1 (inclusive) and END1 |
| 217 | 217 | \(exclusive). If START1 is nil, it defaults to 0, the beginning of | |
| 218 | Case is significant in this comparison if IGNORE-CASE is nil. | 218 | the string; if END1 is nil, it defaults to the length of the string. |
| 219 | Unibyte strings are converted to multibyte for comparison. | 219 | Likewise, in string STR2, compare the part between START2 and END2. |
| 220 | |||
| 221 | The strings are compared by the numeric values of their characters. | ||
| 222 | For instance, STR1 is "less than" STR2 if its first differing | ||
| 223 | character has a smaller numeric value. If IGNORE-CASE is non-nil, | ||
| 224 | characters are converted to lower-case before comparing them. Unibyte | ||
| 225 | strings are converted to multibyte for comparison. | ||
| 220 | 226 | ||
| 221 | The value is t if the strings (or specified portions) match. | 227 | The value is t if the strings (or specified portions) match. |
| 222 | If string STR1 is less, the value is a negative number N; | 228 | If string STR1 is less, the value is a negative number N; |