From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Milan Zimmermann Newsgroups: gmane.emacs.bugs Subject: bug#59469: Adding a simpler duplication of the issue Date: Tue, 22 Nov 2022 02:18:00 -0500 Message-ID: References: <136fc764-48a4-4b03-c520-bd6ef16d9a50@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000013cd405ee09fbb2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36860"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59469@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 22 08:19:16 2022 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 1oxNYp-0009Tp-F4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Nov 2022 08:19:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxNYl-00063R-U8; Tue, 22 Nov 2022 02:19: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 1oxNYd-0005zP-9K for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 02:19:03 -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 1oxNYc-0002Ui-1L for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 02:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxNYb-0007QD-T9 for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2022 02:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Milan Zimmermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2022 07:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59469 X-GNU-PR-Package: emacs Original-Received: via spool by 59469-submit@debbugs.gnu.org id=B59469.166910152428505 (code B ref 59469); Tue, 22 Nov 2022 07:19:01 +0000 Original-Received: (at 59469) by debbugs.gnu.org; 22 Nov 2022 07:18:44 +0000 Original-Received: from localhost ([127.0.0.1]:49531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxNYK-0007Ph-F2 for submit@debbugs.gnu.org; Tue, 22 Nov 2022 02:18:44 -0500 Original-Received: from mail-vs1-f53.google.com ([209.85.217.53]:45714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxNYI-0007PT-DY for 59469@debbugs.gnu.org; Tue, 22 Nov 2022 02:18:42 -0500 Original-Received: by mail-vs1-f53.google.com with SMTP id 128so13599352vsz.12 for <59469@debbugs.gnu.org>; Mon, 21 Nov 2022 23:18:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=f3HQcvFCCiCd1gFME5UJ/t05Vm3ycJbkvWFhrGwX8VA=; b=h0XxBOoldYFxRZuucRtJ2SOzEPS5AgJNi+f4NUFuq5UolOONOyPPfErm/i+p16jjdg RcXN9f431i1k9RqlTc28Is+X77Y1EgeBLC04TCqZ0zxeBjQgyCiM63qB1kqJWNzaAUg6 e5biHisUAaFlNW93+7zJJfxvo6qHeuZ5szzhjcpIHhz4D2KvvjS5nUBvJkM9kZRexiaW 7nFskuL3fanfOuocTSEcSR+Zqcn3dwbVv56+GbfaWMsP6omktA5XWu+5hL/VYPRAkcaV CI9FA26LhzyEZx7zl61bbEXDOM+dUFABUhHjfT53vXDclgJ04wfZ4w+daNFF1TLeWXrR giTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f3HQcvFCCiCd1gFME5UJ/t05Vm3ycJbkvWFhrGwX8VA=; b=14LAQvCOCKwGqlTTbCopdKkjZ4GgXbTzWJ52MADGm2InSUdLcGv/SH3UHyKqApSGva CP2I08fYWdNUcn/guVw3HyG4/Z2Tyn7XZ7T2CTzXtU07ujoE9VIRE9fJcxIjl0/4Leh5 innBfKgaTpyGI0MF4Qhm16z/Pvpr4m3v/ogq5F8k6OT9sS78Ud/ynnhljoSnkevoaieY MR2+2+2teJJU/fEiGzEcbVm4oMAV4MM1nFYFpD3X+RWk3nwwyB24w7dWMoqpjlwV/r9t 5lPG0UYAPXRwLHNbx5zzN4zQv5uFCJnwyOOC+kAVmHdxnMf6EFzVThQN3iMTllSPCRcW npRw== X-Gm-Message-State: ANoB5pmAfxNh9qFN09Y90EN1pEaU+N99Gp4sYZ3Iq5M1HEG3hkTlmZkQ 5GsolSol9jX0yM/U8UIi/rCsA89Tx5c4gaAOTfY= X-Google-Smtp-Source: AA0mqf5glpm/HleVo32SLsZ5zhuiK7axqjITftAtC6mwzzL8RZgXG8xMnpp6yALhpznKMg95mkiueF1CCcX1yeq6P5c= X-Received: by 2002:a05:6102:11e5:b0:3aa:2fea:86f4 with SMTP id e5-20020a05610211e500b003aa2fea86f4mr1539054vsg.54.1669101516830; Mon, 21 Nov 2022 23:18:36 -0800 (PST) In-Reply-To: <136fc764-48a4-4b03-c520-bd6ef16d9a50@gmail.com> 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:248608 Archived-At: --000000000000013cd405ee09fbb2 Content-Type: text/plain; charset="UTF-8" Thanks for the detailed update as always. This is over my elisp level, I got here mostly as a relapsed eshell user, trying to use eshell as my primary shell for the third time :) But it sounds to me like your intuition about this could be fixed by rewriting the core 'eshell-do-eval' loop in bug#57635 can be correct. I would enjoy helping with it, but at the moment it is above my time and elisp abilities. Not sure what to do next regarding this bug, perhaps we should go ahead and add your comment to bug#57635 so these two are linked from both ends? Or let me know if I can help with something else, Thanks, Milan On Mon, Nov 21, 2022 at 11:56 PM Jim Porter wrote: > On 11/21/2022 6:50 PM, Milan Zimmermann wrote: > > A simpler duplication shows the issue is below. > [snip] > > Same bug: After the call to non-elisp program, /usr/bin/gzip, a > > previously exported variable bbb (exported inside the block) is > nullified. > > I'm not entirely sure, but I have a suspicion that this is due to > Eshell's deferred commands. Deferred commands tell Eshell to stop > processing synchronously and yield to the rest of Emacs. It's a way of > keeping long-running commands (e.g. external processes) from hanging the > rest of Emacs. > > Unfortunately, the logic to do this (see 'eshell-do-eval') was written > before lexical binding was added to Emacs Lisp, and I think this is the > cause of quite a few subtle bugs with Eshell command evaluation. Fixing > that is bug#57635, which would leverage the generator.el internals to do > this. > > Of course, I could be wrong. This is reaching well past my comfort zone > for Emacs Lisp, but this sure seems like an issue with 'eshell-do-eval'. > > I'd certainly like to fix this one day, since it's blocking a few other > things I want to do in Eshell, but I think it'll be a pretty big project. > --000000000000013cd405ee09fbb2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the detailed update as always.

This is over my elisp level, I got here mostly as a re= lapsed eshell user, trying to use eshell as my primary shell for the third = time :)

But it sounds to me like your intuition ab= out this could be fixed by rewriting the core 'eshell-do-eval' loop= in bug#57635 can be correct.=C2=A0 I would enjoy helping with=C2=A0=C2=A0it, but at the moment it is above my time and elisp abilities.=

Not sure what to do next regarding this bug, perh= aps we should go ahead and add your comment to=C2=A0=C2=A0=C2=A0bug#57635 s= o these two are linked from both ends? Or let me know=C2=A0if I can help wi= th something else,

Thanks,
Milan


On Mon, Nov 21, 2022 at 11:56 PM Jim Porter <jporterbugs@gmail.com> wrote:
<= /div>
On 11/21/2022 6:50 P= M, Milan Zimmermann wrote:
> A simpler duplication=C2=A0shows the issue is below.
[snip]
> Same bug: After the call to non-elisp program, /usr/bin/gzip, a
> previously exported variable bbb (exported inside the block) is nullif= ied.

I'm not entirely sure, but I have a suspicion that this is due to
Eshell's deferred commands. Deferred commands tell Eshell to stop
processing synchronously and yield to the rest of Emacs. It's a way of =
keeping long-running commands (e.g. external processes) from hanging the rest of Emacs.

Unfortunately, the logic to do this (see 'eshell-do-eval') was writ= ten
before lexical binding was added to Emacs Lisp, and I think this is the cause of quite a few subtle bugs with Eshell command evaluation. Fixing that is bug#57635, which would leverage the generator.el internals to do this.

Of course, I could be wrong. This is reaching well past my comfort zone for Emacs Lisp, but this sure seems like an issue with 'eshell-do-eval&= #39;.

I'd certainly like to fix this one day, since it's blocking a few o= ther
things I want to do in Eshell, but I think it'll be a pretty big projec= t.
--000000000000013cd405ee09fbb2--