unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56509: 29.0.50; Eshell variable aliases don't fully support indexing
@ 2022-07-12  2:47 Jim Porter
  2022-07-12  3:06 ` bug#56509: [PATCH] " Jim Porter
  2022-07-16 12:09 ` Mattias Engdegård
  0 siblings, 2 replies; 6+ messages in thread
From: Jim Porter @ 2022-07-12  2:47 UTC (permalink / raw)
  To: 56509

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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-17  3:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12  2:47 bug#56509: 29.0.50; Eshell variable aliases don't fully support indexing Jim Porter
2022-07-12  3:06 ` bug#56509: [PATCH] " Jim Porter
2022-07-12  4:11   ` Jim Porter
2022-07-12 13:11   ` bug#56509: " Lars Ingebrigtsen
2022-07-16 12:09 ` Mattias Engdegård
2022-07-17  3:13   ` Jim Porter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).