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

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

bug#60942: closed (30.0.50; [PATCH] Indices in Eshell variable interpola


From: GNU bug Tracking System
Subject: bug#60942: closed (30.0.50; [PATCH] Indices in Eshell variable interpolation don't work with async subcommands)
Date: Fri, 20 Jan 2023 01:55:02 +0000

Your message dated Thu, 19 Jan 2023 17:54:01 -0800
with message-id <3bed595c-6f7e-5049-2c8d-bee83d13c3e8@gmail.com>
and subject line Re: bug#60942: 30.0.50; [PATCH] Indices in Eshell variable 
interpolation don't work with async subcommands
has caused the debbugs.gnu.org bug report #60942,
regarding 30.0.50; [PATCH] Indices in Eshell variable interpolation don't work 
with async subcommands
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
60942: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60942
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; [PATCH] Indices in Eshell variable interpolation don't work with async subcommands Date: Wed, 18 Jan 2023 19:36:41 -0800
Starting from "emacs -Q -f eshell":

  ~ $ echo $exec-path[0]
  /usr/local/sbin
  ~ $ echo $exec-path[${echo 0}]
  /usr/local/sbin
  ~ $ echo $exec-path[${*echo 0}]
  ;; no output

This is because 'eshell-eval-indices' gets an S-expr describing code to evaluate for the indices, and it just passes that to 'eval'. That's not the right way to do things for Eshell: instead, we should rely on 'eshell-do-eval', which properly handles asynchronous evaluation. That's required for working with external commands like "*echo" (which calls the real /bin/echo).

The attached patch fixes this by changing 'eshell-eval-indices' to 'eshell-indices', which does some minimal transformations on the S-expr for the indices, and then uses it to build the final S-expr to pass to 'eshell-do-eval'.

This could possibly go in Emacs 29, since it's a bugfix to add onto a previous bugfix (see commit 990f36fa10). However, I'd lean towards just merging to master; this is a fairly obscure issue, and we can't just fix *every* bug we find on the release branch, or the branch will never stabilize. If someone else thinks it's important enough to go on the release branch though, I won't argue.

Attachment: 0001-Fix-evaluation-of-asynchronous-expansions-in-Eshell-.patch
Description: Text document


--- End Message ---
--- Begin Message --- Subject: Re: bug#60942: 30.0.50; [PATCH] Indices in Eshell variable interpolation don't work with async subcommands Date: Thu, 19 Jan 2023 17:54:01 -0800
On 1/19/2023 12:20 PM, Jim Porter wrote:
On 1/19/2023 11:41 AM, Eli Zaretskii wrote:
Is this for master?  If so, okay.  Otherwise, you'll need to adjust
the version in the obsolescence declaration.

Personally, I think just for master. The change isn't entirely risk-free. This code is a bit tricky, and I'd want a fair amount of time for people to identify bugs, just in case I regressed something.

And now merged to master as 54d5ea66c9. Closing this bug.


--- End Message ---

reply via email to

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