From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#57129: 29.0.50; Improve behavior of conditionals in Eshell Date: Sun, 14 Aug 2022 14:40:06 -0700 Message-ID: <5ff283e8-9ced-5894-1075-43bba580185e@gmail.com> References: <8fb3461d-b7eb-23c4-2736-cdd6dfeb1aa0@gmail.com> <87mtc9o5af.fsf@gnus.org> <83h72gmxtq.fsf@gnu.org> <7c04a92b-85f4-41c3-917b-4716cca2b9d6@gmail.com> <83pmh3l8ey.fsf@gnu.org> <9ca08054-5b73-a13e-0478-d838b650317b@gmail.com> <837d3bl1tx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18047"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 57129@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 14 23:41:11 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 1oNLM6-0004YM-JK for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 23:41:10 +0200 Original-Received: from localhost ([::1]:44410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNLM5-00039P-6R for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 17:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNLLy-000391-Dc for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 17:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNLLy-00045w-5f for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 17:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNLLy-000549-0W for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 17:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Aug 2022 21:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57129 X-GNU-PR-Package: emacs Original-Received: via spool by 57129-submit@debbugs.gnu.org id=B57129.166051321819397 (code B ref 57129); Sun, 14 Aug 2022 21:41:01 +0000 Original-Received: (at 57129) by debbugs.gnu.org; 14 Aug 2022 21:40:18 +0000 Original-Received: from localhost ([127.0.0.1]:40003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNLLF-00052n-KK for submit@debbugs.gnu.org; Sun, 14 Aug 2022 17:40:17 -0400 Original-Received: from mail-pg1-f170.google.com ([209.85.215.170]:46686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNLLC-00052U-8v for 57129@debbugs.gnu.org; Sun, 14 Aug 2022 17:40:16 -0400 Original-Received: by mail-pg1-f170.google.com with SMTP id d71so5120034pgc.13 for <57129@debbugs.gnu.org>; Sun, 14 Aug 2022 14:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:from:to:cc; bh=A7I56gc1B07T9YfRdFMxylcCVPj9jdFOrpU0dl4IB5Q=; b=HyBHc/HGNR2tdas7NsO5MoDPY+hVA3zns7M8xwkokytqCAGrxCVl8v2P6kAno+AYYH cSM3s2Q0qck9U6rleM1vwI/0kQUNq1/FbTMwBbs0lz02ICL9SLy8ludAX5KqpFrQIBFd hW7YdMr/tRlkoYCl2dMbYvqNpSBRcQ5bsK91ITXQkEcK+MuHbwvphOlr6z3fspsZE3Ta FZ0XZ3x5zJm9EiRKFGS3oOen9wK1Z427UJNkArJzkQp6w0LBvItYgf7MehddhBmyVs9b yEUf5IRH48nsPoXwuN0VA4pjAvdsXd+wPQMCywYYpb/GbO9vaGOCYThhbM7CstaArkf5 1ZTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:x-gm-message-state :from:to:cc; bh=A7I56gc1B07T9YfRdFMxylcCVPj9jdFOrpU0dl4IB5Q=; b=IEgxcyohjtxyFmUKRbZjyQhsHuMmK0RIn0Z773TbqG6FaSRWC5RODdxr3TfEcsn5Q8 YQDghtLvy3QOQxn1e8b+rM46acbRq23UpgTZQ7zFe0hDxMexYQbPO52Df47QkdIMuaA1 xBmMe5AuadrhoEvYUZobtY4DyXNZCqq6rIe6RZE9WhRTuQWtH3JCKmZ3w2ovj7rlGssI p49GCwiMoBcImymhnUFk5SAhSDMA6WPQZQE5bJIGztyy6Zm6oWPgnTIjBgFcX1s2DK3k 2okQtCjpLGWVrJAqMU/X2XpmVsWMTdzKKtcXrwRpB54k5GU/Ybho74tIERLq9ZWvfRUY jsqA== X-Gm-Message-State: ACgBeo1r3LnCoXEIqgQwAEjU0Rl2dlwQKurrFqZwZb1xBCNvp0+2m65V 2Lfpqnq7GRWsUa0RhBWBFPXw31gwXf8= X-Google-Smtp-Source: AA6agR4bnQoMmIw93LqmOiRu4LxApIivU213FpKYFvdMJTUZkDRcr5Mw7UIp7eJ1SureCXaq92lUYQ== X-Received: by 2002:a05:6a00:22c6:b0:52f:4d67:b370 with SMTP id f6-20020a056a0022c600b0052f4d67b370mr13465479pfj.58.1660513208403; Sun, 14 Aug 2022 14:40:08 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id lk9-20020a17090b33c900b001df264610c4sm10762883pjb.0.2022.08.14.14.40.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Aug 2022 14:40:07 -0700 (PDT) In-Reply-To: <837d3bl1tx.fsf@gnu.org> Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:239705 Archived-At: On 8/14/2022 12:30 AM, Eli Zaretskii wrote: > The manual definitely should be clarified in that matter, because: > > d:/gnu/git/emacs/trunk/src $ which format > format is a built-in function in ‘C source code’. > > To me this says that 'format' is a built-in command, and the manual > says such commands should be invoked in preference to external > commands. The "eshell/" part is not mentioned anywhere. I'll work on a fix for that. This is a little more complex than immediately apparent though, since Eshell also unfortunately uses the term "alias" to refer to two kinds of entities: 1) Command abbreviations created by the user using the 'alias' command, e.g. "alias ll 'ls -l'". These are sometimes called "command aliases", and are implemented in em-alias.el. 2) Lisp functions with names like 'eshell/FOO'. These are sometimes called "alias functions", and are implemented in esh-cmd.el. For example, see 'eshell-find-alias-function', which checks if 'eshell/FOO' exists. It would probably be good to fix all this terminology for once and for all. > I get the same output, with 2 exceptions: > > . the name of the temporary file is different > . instead of a simple string here: > > (eshell-set-output-handle 1 'overwrite "/tmp/QqPFwo")) > > I get a file name split into several parts, which are then > concatenated by eshell-concat: > > (eshell-set-output-handle 1 'overwrite > (eshell-extended-glob > (eshell-concat nil "c:/DOCUME" "~" "1/Zaretzky/LOCALS" "~" "1/Temp/OIi8Wd"))) > > Any chance that the "~" parts here somehow get in the way? It's possible. I think Eshell is trying to ensure that the "~" doesn't get parsed as "home directory" here. But it could be doing something wrong there. I did also touch 'eshell-concat' not too long ago, so I might have broken something there. > If not, any other thoughts? My main worry is that there's something > here specific to how we invoke subprocesses, which you lately changed. You could try some Eshell commands that don't use subprocesses to see if that changes anything. For example, these should only use Lisp functions: ;; Should print "first" in the Eshell buffer: eshell/echo ${eshell/echo $eshell-in-pipeline-p | eshell/echo} eshell/echo ${eshell/echo $eshell-in-pipeline-p | eshell/echo} | eshell/echo ;; Should open a temp file containing "first" in a new buffer: find-file $ find-file $ | eshell/echo The "eshell/" prefix probably isn't necessary, but I figured it's worth being extra-careful here while diagnosing the issue. I'm particularly interested in whether the third and fourth commands work. If they work, that would definitely point towards a bug in Eshell's subprocess handling; if not, then that would point to a bug in the "$" handling. I also filed bug#57216 to add ERT explainers that will print better error messages for most of the Eshell tests. That doesn't address the sometimes-vague documentation of the tests, but I'll do that separately.