diff options
| author | Lars Ingebrigtsen | 2016-02-21 15:32:45 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-21 15:32:45 +1100 |
| commit | 71783e90a46ca913ea2c334cdc8cb24cd74055f8 (patch) | |
| tree | 3c35b883caea4392789d6c991a08bb74475407ad /etc | |
| parent | 1ba50a0d8cbef6686ecf752583832e7bbb9137ef (diff) | |
| download | emacs-71783e90a46ca913ea2c334cdc8cb24cd74055f8.tar.gz emacs-71783e90a46ca913ea2c334cdc8cb24cd74055f8.zip | |
Add the string-numeric-lessp function
* doc/lispref/strings.texi (Text Comparison): Document
`string-numerical-lessp'.
* src/fns.c (Fstring_numeric_lessp): New function.
(gather_number_from_string): Helper function for that function.
* test/src/fns-tests.el (fns-tests-string-numeric-lessp): Add tests.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -1720,6 +1720,12 @@ environment. For the time being this is implemented for modern POSIX | |||
| 1720 | systems and for MS-Windows, for other systems they fall back to their | 1720 | systems and for MS-Windows, for other systems they fall back to their |
| 1721 | counterparts `string-lessp' and `string-equal'. | 1721 | counterparts `string-lessp' and `string-equal'. |
| 1722 | 1722 | ||
| 1723 | +++ | ||
| 1724 | ** The new function `string-numeric-lessp' compares strings by | ||
| 1725 | interpreting consecutive runs of numerical characters as numbers, and | ||
| 1726 | compares their numerical values. According to this predicate, | ||
| 1727 | "foo2.png" is smaller than "foo12.png". | ||
| 1728 | |||
| 1723 | --- | 1729 | --- |
| 1724 | *** The ls-lisp package uses `string-collate-lessp' to sort file names. | 1730 | *** The ls-lisp package uses `string-collate-lessp' to sort file names. |
| 1725 | The effect is that, on systems that use ls-lisp for Dired, the default | 1731 | The effect is that, on systems that use ls-lisp for Dired, the default |