[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#56509: [PATCH] 29.0.50; Eshell variable aliases don't fully support
From: |
Jim Porter |
Subject: |
bug#56509: [PATCH] 29.0.50; Eshell variable aliases don't fully support indexing |
Date: |
Mon, 11 Jul 2022 20:06:04 -0700 |
On 7/11/2022 7:47 PM, Jim Porter wrote:
Normally in Eshell, you can index variables to get the nth element, e.g.
"echo $exec-path[0]" would print the first element in your `exec-path'
variable. However, this doesn't always work for "alias" variables. From
[snip]
There's also a related issue with alias variables that reference other
alias variables...
The attached patches fix these issues. To help make this a bit easier to
follow, the first patch just adds tests and documentation. The only code
change I made was to move the '$INSIDE_EMACS' alias from em-dirs.el to
esh-var.el. That's because, in theory, a person might choose not to use
em-dirs.el (e.g. if they wanted their own implementation of directory
handling), and it would be pretty surprising for the '$INSIDE_EMACS'
variable to go away then too.
The second patch fixes the behavior of alias variables pointing to other
alias variables. While this is technically a change in existing
behavior, I think it's what the code intended, given the pre-existing
documentation for the '$+' variable.
Finally, the third patch makes sure indexing works on all the alias
variables. I tweaked the behavior of a couple of the alias variable
functions and also added a flag to members of
`eshell-variable-aliases-list' to use the "simple" behavior of passing
the result to `eshell-apply-indices'.
0001-Improve-tests-organization-for-built-in-variables.patch
Description: Text document
0002-Allow-Eshell-variable-aliases-to-point-to-other-alia.patch
Description: Text document
0003-Ensure-Eshell-variable-aliases-properly-handle-index.patch
Description: Text document