aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-06-09 19:40:38 -0400
committerNoam Postavsky2017-06-17 00:10:33 -0400
commit27c194995b460b79e8e62e0d21e85d87df664649 (patch)
treede4a84e1355fb6c3042a22c690d3adab1d809043
parent49c0ff29c2e0243ba35ec17e3e3af49369be43db (diff)
downloademacs-27c194995b460b79e8e62e0d21e85d87df664649.tar.gz
emacs-27c194995b460b79e8e62e0d21e85d87df664649.zip
Handle integer indices for eshell variables (Bug#26055)
* lisp/eshell/esh-var.el (eshell-index-value): Convert index to number if it's been marked as one, just like `eshell-lisp-command' does.
-rw-r--r--lisp/eshell/esh-var.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index fe1f1188c88..cdd05bd7e9a 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -563,6 +563,8 @@ For example, to retrieve the second element of a user's record in
563 563
564(defun eshell-index-value (value index) 564(defun eshell-index-value (value index)
565 "Reference VALUE using the given INDEX." 565 "Reference VALUE using the given INDEX."
566 (when (and (stringp index) (get-text-property 0 'number index))
567 (setq index (string-to-number index)))
566 (if (stringp index) 568 (if (stringp index)
567 (cdr (assoc index value)) 569 (cdr (assoc index value))
568 (cond 570 (cond