unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: 56509@debbugs.gnu.org
Subject: bug#56509: 29.0.50; Eshell variable aliases don't fully support indexing
Date: Mon, 11 Jul 2022 19:47:02 -0700	[thread overview]
Message-ID: <e3111834-b5f3-7d2c-9895-0231eb7785be@gmail.com> (raw)

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	other threads:[~2022-07-12  2:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  2:47 Jim Porter [this message]
2022-07-12  3:06 ` bug#56509: [PATCH] 29.0.50; Eshell variable aliases don't fully support indexing 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3111834-b5f3-7d2c-9895-0231eb7785be@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=56509@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).