From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining Date: Tue, 18 Jan 2022 11:40:50 -0700 Message-ID: <87o848evkd.fsf@melete.silentflame.com> References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> <87ft26etuh.fsf@gmx.de> <87tuex1yzo.fsf@melete.silentflame.com> <87czlkbxnh.fsf@gmx.de> <87ee601ey0.fsf@melete.silentflame.com> <871r1yaz36.fsf@gmx.de> <87y245zzjq.fsf@melete.silentflame.com> <83fsqdnc0o.fsf@gnu.org> <87r19xaoqe.fsf@gmx.de> <87o851zwdq.fsf@melete.silentflame.com> <87lf05algc.fsf@gmx.de> <87ilv9zuv4.fsf@melete.silentflame.com> <87fsqd9kch.fsf@gmx.de> <87y23dei2o.fsf@melete.silentflame.com> <83lezdumq4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34226"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 18 20:09: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 1n9tqz-0008hS-UM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 20:09:15 +0100 Original-Received: from localhost ([::1]:58732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9tqy-0004Kb-IO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 14:09:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9tQ2-0004S6-Nt for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 13:41:27 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9tPi-0002L0-1Q for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 13:41:16 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9tPh-0001Lw-RH for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 13:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jan 2022 18:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46351 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46351-submit@debbugs.gnu.org id=B46351.16425312595183 (code B ref 46351); Tue, 18 Jan 2022 18:41:01 +0000 Original-Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 18:40:59 +0000 Original-Received: from localhost ([127.0.0.1]:51679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9tPf-0001LX-Dz for submit@debbugs.gnu.org; Tue, 18 Jan 2022 13:40:59 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9tPd-0001LK-Mx for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 13:40:58 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5AB9A5C004A; Tue, 18 Jan 2022 13:40:52 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 18 Jan 2022 13:40:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=j5qrKHJHxHns1Fj2uqge/MbnPW GJ9UKncpbGuVf7D1I=; b=u5b3W6qN/f1BB8l/wR5fGz5Ck1n1hEmi5rGLv5x2Nj 00kPAYXgf2exKUkgGjoCQZlS9AwiM3hKeyih3efuu/gm6CzwgjaV4jH1XUvzfqax FiAhz/iFshdZPTj6mOxG/2/OUsPIUER0laxb35heW1K6WikKv+oyzIGXxQNG300a 2L0LbSD7M6fWZ4mIti8YWvRAGgDZiFGM6G5ij0nodrCzB/1fegdaaoqxUfoo6qzP LHGt6JSbnEZE3MblAqEx9ntDaKaphGmExnhwSpEw8j0Sf3wkOvTO+uYQYt32mg+N Tqo1ZHYKUy+yw+TlKEAf5Jo9RDIplCBcvZoyDvhMrHyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=j5qrKH JHxHns1Fj2uqge/MbnPWGJ9UKncpbGuVf7D1I=; b=PxgL3bxTnKSyZztPVXcxFL BraClVdBHwugIzarSon6K/B5UFuAwJqo5vyTIYKEn8ukxHKzAqH7kmpX/cSki6nb XczWcjuWLmNgo0A/3i8v71mIno2Uyp0qw0e5oVqv3Is3MeMdbGGrtd71esC7E+6z kaZZI7u43BQ8v0K2P1zq+HFyF4d5Af8gcg7nz3xhrX/kXa6J3wwTHpxWIE1UDRp0 VqSAi64xZ9oOFxmABRF8U3CItwQPeI6pDGIVhNRekdHW+QsTNuWHeDODC88GEp2Y jravKjEFtCQXEP5stHlnxaVDMiD1WpOjsIRSX1QCUH3jIQ8T/aHeDgrDH5zNgNsw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 13:40:51 -0500 (EST) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id E25E27E07DB; Tue, 18 Jan 2022 11:40:50 -0700 (MST) In-Reply-To: <83lezdumq4.fsf@gnu.org> 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:224522 Archived-At: Hello, On Tue 18 Jan 2022 at 04:45PM +02, Eli Zaretskii wrote: > I see you play some games with shell syntactic rules and such: IME, > these are often tricky enough to defeat simplistic handling. For > example, does this support commands that have redirection operators > _before_ the first verb? It's allowed in every shell I've seen, > albeit very rarely used. These things are indeed tricky. So long as it is not too easy to activate the functionality by accident, however, I think that it will be very helpful with regard to one of the most common reasons people cite for not using Eshell very much. > I think Robert found another possible issue. I will incorporate his suggestion to require whitespace. >> +(cl-macrolet >> + ((deftest (name input expected) >> + (let ((result (gensym))) >> + `(ert-deftest ,name () >> + (let* ((shell-file-name "sh") (shell-command-switch "-c") >> + (,result >> + (with-temp-eshell (eshell-parse-command ,input)))) >> + ;; Strip `eshell-trap-errors'. >> + (should (equal (cadr ,result) ,expected))))))) >> + >> + (deftest em-extpipe-test-1 >> + "foo *| bar >baz" >> + '(eshell-named-command "sh" >> + (list "-c" "foo | bar >baz"))) > > Why do these tests only look for 'sh' as the shell? What is the > importance of the shell for this purpose? The code just substitutes in the value of `shell-file-name' (taking TRAMP into account), so there isn't much point in varying that value in the tests, so I just picked something standard. The user is expected to know what syntax their external shell will accept and what it will do with it when they invoke this functionality. Thanks for looking -- please let me know if I have missed any of the points of your questions. -- Sean Whitton