]> git.eshelyaron.com Git - emacs.git/commit
Make 'eshell-number-regexp' into a regular defvar
authorJim Porter <jporterbugs@gmail.com>
Thu, 26 Jan 2023 21:11:15 +0000 (13:11 -0800)
committerJim Porter <jporterbugs@gmail.com>
Sat, 28 Jan 2023 02:03:10 +0000 (18:03 -0800)
commit5642bf0b9726ea299a670e7393695148f31c619b
tree02a01b11590bd8f57f78d7eb74ce2338a0b5f98d
parentdabe0b7d40778496ecb308f54999248ea286d89b
Make 'eshell-number-regexp' into a regular defvar

This isn't a very useful thing to customize, since it needs to detect
numbers that can successfully be parsed by 'string-to-number'.
Changes to this variable would therefore likely requiring adjusting
'eshell-convert-to-number' as well.

* lisp/eshell/esh-util.el (eshell-number-regexp): Make into a defvar
and improve the regexp to support more numbers (including infinity and
NaN).

* test/lisp/eshell/esh-util-tests.el
(esh-util-test/eshell-convert-to-number/floating-point)
(esh-util-test/eshell-convert-to-number/floating-point-exponent)
(esh-util-test/eshell-convert-to-number/non-numeric)
(esh-util-test/eshell-convert-to-number/no-convert): New tests.
lisp/eshell/esh-util.el
test/lisp/eshell/esh-util-tests.el