]> git.eshelyaron.com Git - emacs.git/commit
Allow setting the values of variable aliases in Eshell
authorJim Porter <jporterbugs@gmail.com>
Mon, 26 Sep 2022 04:47:26 +0000 (21:47 -0700)
committerJim Porter <jporterbugs@gmail.com>
Tue, 18 Oct 2022 01:48:52 +0000 (18:48 -0700)
commit7c41016fca5ab0638f1e2fed260e2ee41f3400c2
tree11fe29e20ed60074578e2f2f10d47ed8bd65d404
parentf1caa10f04c980034f5ee6e0748cf3b03f460b2b
Allow setting the values of variable aliases in Eshell

This makes commands like "COLUMNS=40 some-command" work as expected.

* lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): Remove
'process-environment' from here...

* lisp/eshell/esh-var.el (eshell-var-initialize): ... and add to here,
along with 'eshell-variable-aliases-list'.
(eshell-inside-emacs): Convert to a 'defvar-local' to make it settable
in a particular Eshell buffer.
(eshell-variable-aliases-list): Make $?, $$, and $* read-only and
update docstring.
(eshell-set-variable): New function...
(eshell-handle-local-variables, eshell/export, eshell/unset): ... use
it.
(eshell/set, pcomplete/eshell-mode/set): New functions.
(eshell-get-variable): Get the variable alias's getter function when
appropriate and use a safer method for checking function arity.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/set/env-var)
(esh-var-test/set/symbol, esh-var-test/unset/env-var)
(esh-var-test/unset/symbol, esh-var-test/setq, esh-var-test/export)
(esh-var-test/local-variables, esh-var-test/alias/function)
(esh-var-test/alias/function-pair, esh-var-test/alias/string)
(esh-var-test/alias/string/prefer-lisp, esh-var-test/alias/symbol)
(esh-var-test/alias/symbol-pair, esh-var-test/alias/export)
(esh-var-test/alias/local-variables): New tests.

* doc/misc/eshell.texi (Built-ins): Add 'set' and update 'unset'
documentation.
(Variables): Expand documentation of how to get/set variables.
doc/misc/eshell.texi
lisp/eshell/esh-cmd.el
lisp/eshell/esh-var.el
test/lisp/eshell/esh-var-tests.el