From: Noam Postavsky Date: Fri, 9 Jun 2017 23:40:38 +0000 (-0400) Subject: Handle integer indices for eshell variables (Bug#26055) X-Git-Tag: emacs-26.0.90~521^2~57 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=27c194995b460b79e8e62e0d21e85d87df664649;p=emacs.git 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. --- 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 (defun eshell-index-value (value index) "Reference VALUE using the given INDEX." + (when (and (stringp index) (get-text-property 0 'number index)) + (setq index (string-to-number index))) (if (stringp index) (cdr (assoc index value)) (cond