bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56509: 29.0.50; Eshell variable aliases don't fully support indexing


From: Jim Porter
Subject: bug#56509: 29.0.50; Eshell variable aliases don't fully support indexing
Date: Mon, 11 Jul 2022 19:47:02 -0700

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 "emacs -Q -f eshell":

  ~ $ alias first 'echo $1[0]'

  ~ $ first (list 1 2)
  (1 2)

This should return 1, since it says to print the first (well, 0th) element of the first argument.

There's also a related issue with alias variables that reference other alias variables:

  ~ $ echo $PWD
  /home/jim

  ~ $ echo $+
  /home/jim

  ~ $ cd ..

  /home $ echo $PWD
  /home

  /home $ echo $+
  /home/jim

The '$+' alias is mapped to '$PWD', but rather than using Eshell's definition for '$PWD', it erroneously consults the system's '$PWD' environment variable, which in this case is the directory that Emacs was started from.

Patch forthcoming; just getting a bug number.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]