diff options
| author | Leo Liu | 2014-09-26 08:15:21 +0800 |
|---|---|---|
| committer | Leo Liu | 2014-09-26 08:15:21 +0800 |
| commit | 89b354a55e30978444ada5d388e18f5e06bde583 (patch) | |
| tree | 0f272431b9522c96aeff74b5d262869d26c4bc3f /doc | |
| parent | b8e352d077f14c52d7e6baa1800def8d3ec61f06 (diff) | |
| download | emacs-89b354a55e30978444ada5d388e18f5e06bde583.tar.gz emacs-89b354a55e30978444ada5d388e18f5e06bde583.zip | |
Add cl-parse-integer based on parse-integer
* doc/misc/cl.texi (Predicates on Numbers): Document cl-digit-char-p.
(Numerical Functions): Document cl-parse-integer.
* lisp/calendar/parse-time.el (parse-time-digits): Remove.
(digit-char-p, parse-integer) Moved to cl-lib.el.
(parse-time-tokenize, parse-time-rules, parse-time-string): Use
cl-parse-integer.
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer): New function.
* lisp/emacs-lisp/cl-lib.el (cl-digit-char-table): New var.
(cl-digit-char-p): New function.
* test/automated/cl-lib.el (cl-digit-char-p, cl-parse-integer): New
tests.
Fixes: debbugs:18557
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 2963bde04e1..a7244f12aba 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-09-26 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * cl.texi (Predicates on Numbers): Document cl-digit-char-p. | ||
| 4 | (Numerical Functions): Document cl-parse-integer. (Bug#18557) | ||
| 5 | |||
| 1 | 2014-09-24 Ulf Jasper <ulf.jasper@web.de> | 6 | 2014-09-24 Ulf Jasper <ulf.jasper@web.de> |
| 2 | 7 | ||
| 3 | * newsticker.texi: Reworked. Document new treeview group | 8 | * newsticker.texi: Reworked. Document new treeview group |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index b2914adc062..04a0e5725e8 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -2929,6 +2929,12 @@ This predicate tests whether @var{integer} is even. It is an | |||
| 2929 | error if the argument is not an integer. | 2929 | error if the argument is not an integer. |
| 2930 | @end defun | 2930 | @end defun |
| 2931 | 2931 | ||
| 2932 | @defun cl-digit-char-p char radix | ||
| 2933 | Test if @var{char} is a digit in the specified @var{radix} (default is | ||
| 2934 | 10). If true return the decimal value of digit @var{char} in | ||
| 2935 | @var{radix}. | ||
| 2936 | @end defun | ||
| 2937 | |||
| 2932 | @node Numerical Functions | 2938 | @node Numerical Functions |
| 2933 | @section Numerical Functions | 2939 | @section Numerical Functions |
| 2934 | 2940 | ||
| @@ -3011,6 +3017,15 @@ This function returns the same value as the second return value | |||
| 3011 | of @code{cl-truncate}. | 3017 | of @code{cl-truncate}. |
| 3012 | @end defun | 3018 | @end defun |
| 3013 | 3019 | ||
| 3020 | @defun cl-parse-integer string &key start end radix junk-allowed | ||
| 3021 | This function implements the Common Lisp @code{parse-integer} | ||
| 3022 | function. It parses an integer in the specified @var{radix} from the | ||
| 3023 | substring of @var{string} between @var{start} and @var{end}. Any | ||
| 3024 | leading and trailing whitespace chars are ignored. It signals an error | ||
| 3025 | if the substring between @var{start} and @var{end} cannot be parsed as | ||
| 3026 | an integer unless @var{junk-allowed} is non-nil. | ||
| 3027 | @end defun | ||
| 3028 | |||
| 3014 | @node Random Numbers | 3029 | @node Random Numbers |
| 3015 | @section Random Numbers | 3030 | @section Random Numbers |
| 3016 | 3031 | ||