1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-31 17:30:54 -08:00
emacs/lisp/eshell
Jim Porter 43d5b7a04c 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.
2024-10-19 12:01:10 -07:00
..
em-alias.el Use 'eshell-with-handles' in a few more places 2024-08-28 18:48:28 -07:00
em-banner.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-basic.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-cmpl.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-dirs.el ; * lisp/eshell/em-dirs.el (eshell/cd): Remove extraneous 'eshell-protect'. 2024-08-01 09:31:44 -07:00
em-elecslash.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
em-extpipe.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
em-glob.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-hist.el Don't save to history from 'eshell-command' when aborting 2024-07-15 09:10:30 -07:00
em-ls.el Be more efficient when buffering output in Eshell 2024-06-08 12:29:29 -07:00
em-pred.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
em-prompt.el Ensure navigating by paragraphs in Eshell stops at prompts and paragraphs 2024-06-20 19:01:20 -07:00
em-rebind.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-script.el Fix redirecting Eshell output to symbols in some places 2024-08-29 21:51:25 -07:00
em-smart.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-term.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-tramp.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
em-unix.el Improve correctness of 'eshell-quote-argument' 2024-06-09 15:28:40 -07:00
em-xtra.el Use 'esh-module-autoload' for Eshell modules' defgroups 2024-05-29 12:09:05 -07:00
esh-arg.el Lazily convert numeric strings to Lisp numbers in Eshell 2024-10-19 12:01:10 -07:00
esh-cmd.el Add support for chaining conditionals in Eshell 2024-10-16 21:48:36 -07:00
esh-ext.el Fix execution of MS-Windows app execution aliases in Eshell 2024-07-07 20:25:09 -07:00
esh-io.el Improve correctness of Eshell sub-forms 2024-10-16 21:48:35 -07:00
esh-mode.el ; Mark interactive Eshell output as such after inserting into the buffer 2024-10-17 14:30:31 -07:00
esh-module.el Checkdoc fixes in eshell/*.el 2024-07-08 16:51:05 +02:00
esh-opt.el ; Compute the list of symbols for 'eshell-eval-using-options' once 2024-02-13 12:27:38 -08:00
esh-proc.el ; Mark interactive Eshell output as such after inserting into the buffer 2024-10-17 14:30:31 -07:00
esh-util.el Lazily convert numeric strings to Lisp numbers in Eshell 2024-10-19 12:01:10 -07:00
esh-var.el Lazily convert numeric strings to Lisp numbers in Eshell 2024-10-19 12:01:10 -07:00
eshell.el Fix redirecting Eshell output to symbols in some places 2024-08-28 18:53:03 -07:00