]> git.eshelyaron.com Git - emacs.git/commit
Improve handling of local variable settings in Eshell
authorJim Porter <jporterbugs@gmail.com>
Fri, 26 Jan 2024 01:54:13 +0000 (17:54 -0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 26 Jan 2024 11:23:23 +0000 (12:23 +0100)
commite83d7d446dcb417ba73b35ef9c8f4d46f76016ce
treecf78609ccaf6a59c05c3fcf1e11a1caf0fb19778
parent26d2714699059117c9031f647aec8964552aa101
Improve handling of local variable settings in Eshell

This ensures that these commands work the same as normal commands,
aside from making environment variable settings local to that command.
Among other things, this means that "VAR=value cd dir/" now changes
the directory correctly.

* lisp/eshell/esh-var.el (eshell-in-local-scope-p)
(eshell-local-variable-bindings): New variables.
(eshell-var-initialize, eshell-set-variable): Use
'eshell-local-variable-bindings'.
(eshell-handle-local-variables): Don't use 'eshell-as-subcommand'.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/cd):
New test.

(cherry picked from commit 65829b27ca4898ff0905a8124980243977a1382f)
lisp/eshell/esh-var.el
test/lisp/eshell/esh-var-tests.el