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#57129: 29.0.50; Improve behavior of conditionals in Eshell Date: Sun, 14 Aug 2022 10:30:02 +0300 Message-ID: <837d3bl1tx.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30355"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 57129@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 14 09:31:38 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 1oN85x-0007nc-W5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 09:31:38 +0200 Original-Received: from localhost ([::1]:56938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oN85u-0007XJ-LB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 03:31:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oN85Q-0007Wv-2u for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 03:31:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oN85O-00021D-OX for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 03:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oN85O-00015s-Gz for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 03:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Aug 2022 07:31:02 +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.16604622274149 (code B ref 57129); Sun, 14 Aug 2022 07:31:02 +0000 Original-Received: (at 57129) by debbugs.gnu.org; 14 Aug 2022 07:30:27 +0000 Original-Received: from localhost ([127.0.0.1]:35719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oN84p-00014r-DZ for submit@debbugs.gnu.org; Sun, 14 Aug 2022 03:30:27 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oN84m-00014Z-QX for 57129@debbugs.gnu.org; Sun, 14 Aug 2022 03:30:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oN84h-0001je-Cs; Sun, 14 Aug 2022 03:30:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=hTx1+YY9mnnSi2UQLyjmHsrq5eQSJaRSMMpS3QoY3Nk=; b=M0OmwcWm++w0Xrd9G0F4 8hokq02LmY8cfuQNxXRTJcdwZuuAchPVTw53yAhuGvZU9nfYHIkSciuK2BBzk0KIP98F55wGJjrr8 afVO+k+6S0e6gzZlu1736cyhD/nPlmUxzIqTZ2aiKlTJutK4WLvnocaSuEGflEervycugsshmhKWE qoaIajeNmNgcm56nHvK8fFgA2ECxaRpwrWRzHHU5AzcrphldoVqaAiZta8PmnJ6/gCNEVCVynxiB9 Pj8lwYL4mGHIzCdOp/XMrKPtKPgyqkzs5seFbfF42I6QEOiNoz4Y9Kpkepcc3cAyrK7q//0zeJZwS GXs9LgmOQTHntw==; Original-Received: from [87.69.77.57] (port=3169 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 1oN84g-00060B-SS; Sun, 14 Aug 2022 03:30:19 -0400 In-Reply-To: <9ca08054-5b73-a13e-0478-d838b650317b@gmail.com> (message from Jim Porter on Sat, 13 Aug 2022 22:37:12 -0700) 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:239626 Archived-At: > Cc: larsi@gnus.org, 57129@debbugs.gnu.org > From: Jim Porter > Date: Sat, 13 Aug 2022 22:37:12 -0700 > > > But then this fragment from the Eshell manual: > > > > The command can be either an Elisp function or an external command. > > Eshell looks first for an alias (*note Aliases::) with the same name as > > the command, then a built-in (*note Built-ins::) or a function with the > > same name; if there is no match, it then tries to execute it as an > > external command. > > > > seems to be inaccurate? Since 'format' exists as a built-in command, > > why did Eshell in this case invoke the external command instead? > > "Built-in" in that part of the manual refers to a function named > 'eshell/FOO'. If you run "FOO" as an Eshell command, it will check for > 'eshell/FOO' before an external command on your system. The manual could > probably stand to be improved here. 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. > If you'd like to dig into this further yourself, you could try running > this command in Eshell: > > eshell-parse-command '*cat $ | *cat' > > That will print the Lisp form that the command gets converted to. I've > attached the result that I get in a recent Emacs 29 build on GNU/Linux. 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? If not, any other thoughts? My main worry is that there's something here specific to how we invoke subprocesses, which you lately changed.