1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-25 01:10:47 -08:00
emacs/doc
Jim Porter dabe0b7d40 Add support for negative indices and index ranges in Eshell
* lisp/eshell/esh-util.el (eshell-integer-regexp): New defvar.

* lisp/eshell/esh-var.el (eshell-parse-indices): Expand docstring.
(eshell-parse-index): New function.
(eshell-apply-indices): Use 'eshell-parse-index' to determine whether
to treat the first index as a regexp.  Simplify the implementation a
bit.
(eshell-index-range): New pcase macro...
(eshell-index-value): ... use it, and restructure the implementation.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-indices):
New function...
(esh-var-test/interp-var-indices/list)
(esh-var-test/interp-var-indices/vector)
(esh-var-test/interp-var-indices/ring)
(esh-var-test/interp-var-indices/split): ... use it.
(esh-var-test/interp-var-string-split-indices)
(esh-var-test/interp-var-regexp-split-indices)
(esh-var-test/interp-var-assoc): Expand tests to cover things that
look like numbers or ranges, but aren't.

* doc/misc/eshell.texi (Variables): Describe how to get all arguments
of the last command.
(Dollars Expansion): Explain negative indices and index ranges.
(Bugs and ideas): Remove now-implemented ideas.

* etc/NEWS: Announce this change.
2023-01-27 18:03:10 -08:00
..
emacs Merge from origin/emacs-29 2023-01-27 11:30:38 +01:00
lispintro ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
lispref Add `yes-or-no-prompt' user option 2023-01-23 09:17:15 +01:00
man ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
misc Add support for negative indices and index ranges in Eshell 2023-01-27 18:03:10 -08:00