From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60942: 30.0.50; [PATCH] Indices in Eshell variable interpolation don't work with async subcommands Date: Thu, 19 Jan 2023 08:49:34 +0200 Message-ID: <83wn5jyq69.fsf@gnu.org> References: <20e5cb2f-aabe-53fd-d3af-81ec5ff11e7b@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11362"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60942@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 19 07:50:32 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIOkp-0002jA-Jn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Jan 2023 07:50:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIOkV-0005Y4-CG; Thu, 19 Jan 2023 01:50:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIOkN-0005W3-9n for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 01:50:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIOkM-0006i0-UY for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 01:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIOkM-0005xC-G4 for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 01:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2023 06:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60942 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60942-submit@debbugs.gnu.org id=B60942.167411097122841 (code B ref 60942); Thu, 19 Jan 2023 06:50:02 +0000 Original-Received: (at 60942) by debbugs.gnu.org; 19 Jan 2023 06:49:31 +0000 Original-Received: from localhost ([127.0.0.1]:42396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIOjq-0005wJ-Mp for submit@debbugs.gnu.org; Thu, 19 Jan 2023 01:49:30 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIOjo-0005w6-94 for 60942@debbugs.gnu.org; Thu, 19 Jan 2023 01:49:28 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIOji-0006gO-Oy; Thu, 19 Jan 2023 01:49:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BGp/B4Ss+VlsXZn7yJBX88tWICobivqVgwInBdggwwE=; b=lPZIdbshqbPH UnlyB5sm19nOHsY0nGNugV4eUlYKO/7n3IPsRiAlkrsTACgQpwO+OjXMVuvwkOZ/5GA3LFlKoqZWc v7f3k1Cp1xXfWc7VRIc4TLSoCJBYmKuF38epEgQwzs7VKkXnO/WaGRgYhVp98FOgej0dzCZRLDoJU h3lKKvsfo8u+bCnrmu55OPOXXVbL6NLf0+og6+N1thcyJI07YMYYYLLkG8dMFg71OhJsiUGGN1ABA j26Lew/3OOV35HHMjIONVVfSpFPOzVDhN9TrlguCeIEvnte3PwKSti5i0F+PwBDoLzmk6GpHWJRk5 qRl1dFbvyp2WsKZ+hdFjhg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIOjf-0008Tw-UP; Thu, 19 Jan 2023 01:49:21 -0500 In-Reply-To: <20e5cb2f-aabe-53fd-d3af-81ec5ff11e7b@gmail.com> (message from Jim Porter on Wed, 18 Jan 2023 19:36:41 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253679 Archived-At: > Date: Wed, 18 Jan 2023 19:36:41 -0800 > From: Jim Porter > > 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. Why do you remove a non-internal function? We cannot possibly do that if this is going to be installed on the emacs-29 branch. But even if you are going to install on master, why not leave that function alone? Some code somewhere could be using it, and we don't usually remove functions before a period of deprecation.