]> git.eshelyaron.com Git - emacs.git/commit
Remove empty Eshell commands when parsing
authorJim Porter <jporterbugs@gmail.com>
Sun, 9 Jun 2024 20:17:53 +0000 (13:17 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 10 Jun 2024 07:26:57 +0000 (09:26 +0200)
commit53dfcd232748fdf7f713307d3851c7e9031c9e9c
treef0870519ebf86d20694f029485c3c11a719270c8
parenta3e37aa1b08266bf72e7bb0dbaf274058cda0aa1
Remove empty Eshell commands when parsing

This improves the logic for copying/stealing handles when constructing
the command form: now, we should always steal the handles for the last
real command, even if there were some trailing semicolons.

* lisp/eshell/esh-arg.el (eshell-parse-delimiter): Be stricter about
parsing so that things like "& &" aren't parsed as a single "&&" token.

* lisp/eshell/esh-cmd.el (eshell-parse-command): Get the commands in
reverse, and remove any nil commands.
(eshell-split-commands): Always return the trailing terms (except when
there were no terms to begin with).

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/empty-background-command): New test.

(cherry picked from commit 00649042f3057c9ea2e6a4944924293998e2a527)
lisp/eshell/esh-arg.el
lisp/eshell/esh-cmd.el
test/lisp/eshell/esh-cmd-tests.el