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.devel Subject: Re: Eshell's external pipe module interferes with other argument parsing hooks Date: Sat, 16 Apr 2022 14:04:34 -0700 Message-ID: <877d7okae5.fsf@melete.silentflame.com> References: <70677cd2-f741-16d1-b38f-c39b507cc95e@gmail.com> <871qyij7vx.fsf@melete.silentflame.com> <877d89iy53.fsf@melete.silentflame.com> <0ac470ac-87e2-f3e9-7e23-28a6622ef082@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6296"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Emacs/29.0.50 (x86_64-pc-linux-gnu) To: Jim Porter , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 16 23:06:28 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nfpch-0001So-F8 for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Apr 2022 23:06:28 +0200 Original-Received: from localhost ([::1]:41378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfpcg-00010P-DZ for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Apr 2022 17:06:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfpax-00081V-DN for emacs-devel@gnu.org; Sat, 16 Apr 2022 17:04:39 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:38271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfpav-0001FG-DA for emacs-devel@gnu.org; Sat, 16 Apr 2022 17:04:39 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id B8DB13201FDD; Sat, 16 Apr 2022 17:04:35 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 16 Apr 2022 17:04:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1650143074; x=1650229474; bh=M5twS709sJ xfGlb1FHRXVWK7rZRi6hN7C6voXtC45dg=; b=NwrEuNSUTRO9ROCFIuTUD13QET bz1htBsu9dCAecGm8wbuF+lQ98pgDBF6c2upD0Xe7dTTwMAwQyBIJOsF9cZvyUjH 7h0A0Hs2MiuamuoB0J8G8n1pGTO9HBjzxcP4Fl0fWGomDfIH/3QZUTpxnCOw8haJ H4xBil3kWbmlpSzf8mETalqEhmjq1D61vX6c43GMNrCShNeb+wefVNFi1vut72hY p5pNKLwupT6PglYW5idhmlWHZewl4DrXt9X94kOQDPadkGxKn5OZXA3+X2NKy/iB AGLqE8Vnc3IfD9fFKmUrKubIZz2rPLlGwWd9nftMZ+rfiT0ZvOmSiJeYUACg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650143074; x= 1650229474; bh=M5twS709sJxfGlb1FHRXVWK7rZRi6hN7C6voXtC45dg=; b=x hqkhMjCPxZSVGzXLG6mRYO0i5FBlsxa1tZAUs93+GqH0FHgxo4/UGVrAZoFkCAlZ BKw4YLXpVP+KON/VaVX3YUvTAdOZGzxBQsjAsNhCcv91sm9HJLr50bGKsN3ugwfT 8Qz2+UkDuZGqM8GjpEPMFHht1yBR3B1l5zLuZASr+ektBkOlrhRE/br8NmApROTM deMHM2VbNMfbo30LgYOtfRRG5k755AEH+1cvny5dRDqPtOSo0Ga0zHag9w4DCQZP roA5sHJh1I+0FZOFI9MQsaNbIQlkMyQ/z793H7XlrnCAc5fmHfwoohq5rPstO7g+ fOxjD3lf1lLEEICbr3izA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeljedgudehkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehttd dttddtredtnecuhfhrohhmpefuvggrnhcuhghhihhtthhonhcuoehsphifhhhithhtohhn sehsphifhhhithhtohhnrdhnrghmvgeqnecuggftrfgrthhtvghrnhepleeggefgvdeije dvhfdugfegtefgkeekueeileejjeehudeggeefteeghfeuffeknecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhpfihhihhtthhonhesshhpfi hhihhtthhonhdrnhgrmhgv X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Apr 2022 17:04:34 -0400 (EDT) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 092637E511F; Sat, 16 Apr 2022 14:04:34 -0700 (MST) In-Reply-To: <0ac470ac-87e2-f3e9-7e23-28a6622ef082@gmail.com> Received-SPF: pass client-ip=64.147.123.25; envelope-from=spwhitton@spwhitton.name; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288509 Archived-At: Hello, On Thu 31 Mar 2022 at 04:11PM -07, Jim Porter wrote: > In practice, yes. However, the implementation could allow the other > parsers to run, but then discard their parsed results during the rewrite > phase if applicable. This is probably subject to a different set of > unusual corner cases, but would allow other parsers to consume the parts > of the command that they care about so that extpipe can just look for > `*|' and friends. (A `*|' sequence inside quotes or something similar > would already have been consumed by the time extpipe sees it.) Okay, I think I see what you mean. Worth keeping in mind. > For the purposes of parsing, having the token that activates the extpipe > module be at the beginning of the relevant portion would make things a > lot easier. Then `eshell-parse-external-pipeline' can just check if > that's the next token and if so, read until the end of the extpipe > portion. That would eliminate all the complexity of trying to identify > unquoted/literal `*|' operators. > > In practice though, I'm happy with any syntax so long as the > implementation is robust. If the current implementation using `*|' > operators is significantly nicer to use (I don't have an opinion either > way since I haven't used it enough), then we should stick with it, even > if it makes it harder to implement. I think it's pretty nice to use, indeed. But one thing that isn't so easy that I would additionally like to have is just converting a single command, with no pipes or redirection, to use the external shell. You can do something like append "*| cat" to your command but that's not nice. One possibility discussed previously was to support putting || at the very beginning of the command to request that the whole thing be sent to the external shell. I'm still thinking I might add that. -- Sean Whitton