diff options
| author | Jim Porter | 2024-10-19 11:52:42 -0700 |
|---|---|---|
| committer | Jim Porter | 2024-10-19 12:01:10 -0700 |
| commit | 43d5b7a04c4b1a8a7d57f25824df2e8720d2c567 (patch) | |
| tree | 189201134e9e92c6bbf156ebb772f573f65cf71f /java | |
| parent | c2a9f519f7e9a5cbb5dbe50ba7b4e4b2757bb3b6 (diff) | |
| download | emacs-43d5b7a04c4b1a8a7d57f25824df2e8720d2c567.tar.gz emacs-43d5b7a04c4b1a8a7d57f25824df2e8720d2c567.zip | |
Lazily convert numeric strings to Lisp numbers in Eshell
This should reduce the number of issues with Eshell converting strings
to numbers too aggressively and losing information (e.g. "001" -> 1)
while still allowing almost all of the beneficial uses, like summing a
list of numeric strings with '+'.
* lisp/eshell/esh-util.el (eshell--do-mark-numeric-string): New
function.
(eshell-convert-to-number): Make obsolete in favor of...
(eshell-mark-numeric-string): ... this. Update callers.
* lisp/eshell/esh-arg.el (eshell--numberlike-p): New function...
(eshell-concat-1): ... use it.
* test/lisp/eshell/esh-util-tests.el: Reimplement type conversion tests
to use 'eshell-convertible-to-number-p' instead.
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/interp-var-splice-concat, esh-var-test/interp-concat-cmd)
(esh-var-test/interp-convert-var-split-indices)
(esh-var-test/interp-convert-quoted-var-split-indices)
(esh-var-test/interp-convert-cmd-multiline)
(esh-var-test/interp-convert-cmd-split-indices): Adjust tests to check
the new behavior.
* doc/misc/eshell.texi (Type Conversion): New section.
(Expansion): Clarify concatenation behavior.
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions