]> git.eshelyaron.com Git - emacs.git/commit
Improve handling of Eshell "for" loops
authorJim Porter <jporterbugs@gmail.com>
Sun, 3 Nov 2024 19:22:27 +0000 (11:22 -0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 8 Nov 2024 13:30:00 +0000 (14:30 +0100)
commit179cc3d7b9ddfb2f1888935bf8d7f08706b75273
tree214a1f0756bfbb728843934fffc0b2116c483cd2
parent00777543b3064195ae6bed334a1cb42cd72a5d3c
Improve handling of Eshell "for" loops

This fixes some errors with more-complex string forms, and also allows
iterating over sequences other than just lists.

* lisp/eshell/esh-cmd.el (eshell-for-iterate): New function...
(eshell-rewrite-for-command): ... use it.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/for-loop): Test
multiple values.
(esh-cmd-test/for-loop-string, esh-cmd-test/for-loop-vector): New tests.
(esh-cmd-test/for-loop-mixed-args): Rename.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sentinel/change-buffer): Make sure all the processes get
cleaned up.

(cherry picked from commit 08d5994b435c119bde8b8ac8f7152810d1814d1e)
lisp/eshell/esh-cmd.el
test/lisp/eshell/esh-cmd-tests.el
test/lisp/eshell/esh-proc-tests.el