From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 06 15:06:14 2021 Received: (at submit) by debbugs.gnu.org; 6 Feb 2021 20:06:14 +0000 Received: from localhost ([127.0.0.1]:46507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8TqQ-0006Ew-3Q for submit@debbugs.gnu.org; Sat, 06 Feb 2021 15:06:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:41388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8TqK-0006Eg-7c for submit@debbugs.gnu.org; Sat, 06 Feb 2021 15:06:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8TqJ-0001CF-Ug for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2021 15:06:08 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8TqE-0003WB-Kn for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2021 15:06:07 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id F182FD43 for ; Sat, 6 Feb 2021 15:06:00 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 06 Feb 2021 15:06:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:date:message-id:mime-version:content-type; s= fm2; bh=xFVppfuaA/xSv23xhAoBA9UZEx2Wo1lsi1ufwdwgpMM=; b=QGSrkhHY Yv10jcwaOND6I5REHP2wQGwsv19RbMGPE03KhZKXYENFgZUZCui4rqW0Tkha8TXK OkItXe9Fk3tXD5Bt6zkZ2HA3IexRLHb31M1F6QVaUET+oJmoJGoEZ7pRjmJrq2hv XxLKn7AwGtB7yb84bmyPqdDHaQIuAwEkpygVsOBw04zdsNsNHCfald2Q1au2uGhJ Mk18KuW/7M9lkwK9JgeUmwFD4nMqJKE+/b7nx9Mk/RaqLH+4uWOi/Ntz9A/nNKx/ zfAyHn+pyzORBLNpNIrCjy+WtqmQSgv1tV2rmzrifrWK4xo8KnaxnwWISTpyYOM1 6T+lFnVfQgBl7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=xFVppfuaA/xSv23xhAoBA9UZEx2Wo 1lsi1ufwdwgpMM=; b=AEOEE9LgoSEYjTxB6ZtSbJJplGhJaspOoSUPiyWZetDwL MsQ0+bwtlARVBi9ezNrmMz0ICPkhdhlrDEFIo+mIb+/ivDCWzy03Y5zFM463K18g 2lM7h7b/Lyyep6GhtRfBXFp6R9e1Q5v4s+PPfh9QnvqsEcReDqJg8MkjpCWtidXZ 0zn8LkcA39bghTSE8AkAmfZ3BQdMM6Z4EkPQVE+9VJ1B0hVt/gN8tKJoopcgIDKe fAwOb2Rb2NWykHli0k/lr2JTWBAj+CJ6CEz3+cKk9eLw7K2lVjSzUJJ0v59aVBcX pd8MoyyUlBOfOdAMAXBbcWZokWPPXRJKg3frvzL8A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgeekgddufeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehmtderredttd dtnecuhfhrohhmpefuvggrnhcuhghhihhtthhonhcuoehsphifhhhithhtohhnsehsphif hhhithhtohhnrdhnrghmvgeqnecuggftrfgrthhtvghrnhepteegtdejheejvdehgeettd dvjeffudetuedutdegkefhtdetteeuueetkeefkeegnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtth honhdrnhgrmhgv X-ME-Proxy: From: Sean Whitton To: bug-gnu-emacs@gnu.org Subject: 28.0.50; Add convenient way to bypass Eshell's own pipelining Date: Sat, 06 Feb 2021 13:06:53 -0700 Message-ID: <878s812c6a.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.147.123.24; envelope-from=spwhitton@spwhitton.name; helo=wout1-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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain Most people who use Eshell a lot need to be aware of the limitations of its support for shell pipelines: primarily, that all data in pipelines has to go through Emacs buffers, and that can be slow. If you're running pipelines which will move a lot of data, you should use a system shell which will be more performant. Currently, if Eshell is your primary shell, it's not particularly convenient to switch to using an operating system shell when you're preparing a pipeline that you know is going to move a lot of data. You would need either to switch to a shell-mode buffer, or quote and escape your Eshell input and put something like `bash -c' in front of it. I think that it would be good to have a way to easily toggle Eshell's own pipelining support on and off for particular commands. I have come up with the attached patches. When the new functions I've defined are enabled, you can type !! foo | bar 'arg' >baz >># and it will be executed by Eshell as if you had typed bash -c 'foo | bar '"'"'arg'"'"' >baz' >># The idea is that you can easily toggle Eshell's pipelining on and off as appropriate to your needs just by adding and removing the "!!" prefix. I think that the patches I've prepared are a clean implementation of this feature that would be good to include in Emacs. -- Sean Whitton --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-eshell-restore-unexpanded-input.patch >From ccc4427ff06bf6dc63840517aefbb7fb899d4b8c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 6 Feb 2021 00:01:50 -0700 Subject: [PATCH 1/2] Add eshell-restore-unexpanded-input * lisp/eshell/esh-mode.el (eshell-send-input): Store the original input before running eshell-expand-input-functions. * lisp/eshell/esh-mode.el (eshell-restore-unexpanded-input): Define new function and register as a customization option for eshell-input-filter-functions. --- lisp/eshell/esh-mode.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index d29b010ea0..6036829941 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -197,6 +197,7 @@ This is used by `eshell-watch-for-password-prompt'." ;; byte-compiler, when compiling other files which `require' this one (defvar eshell-mode nil) (defvar eshell-command-running-string "--") +(defvar eshell-last-unexpanded-input nil) (defvar eshell-last-input-start nil) (defvar eshell-last-input-end nil) (defvar eshell-last-output-start nil) @@ -631,6 +632,7 @@ newline." (progn (setq input (buffer-substring-no-properties eshell-last-output-end (1- (point)))) + (setq eshell-last-unexpanded-input input) (run-hook-with-args 'eshell-expand-input-functions eshell-last-output-end (1- (point))) (let ((cmd (eshell-parse-command-input @@ -664,6 +666,21 @@ newline." (custom-add-option 'eshell-input-filter-functions 'eshell-kill-new) +(defun eshell-restore-unexpanded-input () + "Restore the input text before `eshell-expand-input-functions' ran. +Useful when you want to see the unexpanded input rather than the +expanded input in the Eshell buffer, and when you want later +entries in `eshell-input-filter-functions' to use the unexpanded +input. For example, you might want the unexpanded input to be +what gets stored in the history list." + (setf (buffer-substring eshell-last-input-start + (1- eshell-last-input-end)) + eshell-last-unexpanded-input) + (eshell-update-markers eshell-last-output-end)) + +(custom-add-option 'eshell-input-filter-functions + 'eshell-restore-unexpanded-input) + (defun eshell-output-filter (process string) "Send the output from PROCESS (STRING) to the interactive display. This is done after all necessary filtering has been done." -- 2.29.2 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Add-eshell-shell-command-and-eshell-expand-to-eshell.patch >From d5d48427c75555cd5cf2f6eb5b89e0c832cf7edf Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 6 Feb 2021 00:48:32 -0700 Subject: [PATCH 2/2] Add eshell-shell-command and eshell-expand-to-eshell-shell-command * lisp/eshell/esh-mode.el (eshell-shell-command, eshell-expand-to-eshell-shell-command): Define new functions. Register eshell-expand-to-eshell-shell-command as a customization option for eshell-expand-input-functions. --- lisp/eshell/esh-mode.el | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 6036829941..b3132393a5 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -62,6 +62,7 @@ (require 'esh-module) (require 'esh-cmd) (require 'esh-arg) ;For eshell-parse-arguments +(require 'subr-x) (defgroup eshell-mode nil "This module contains code for handling input from the user." @@ -660,6 +661,82 @@ newline." (run-hooks 'eshell-post-command-hook) (insert-and-inherit input))))))))) +(defun eshell-shell-command (command) + "Execute COMMAND using the operating system shell." + (throw 'eshell-replace-command + (eshell-parse-command shell-file-name + (list shell-command-switch command)))) + +(defun eshell-expand-to-eshell-shell-command (beg end) + "Expand Eshell input starting with '!!' to use `eshell-shell-command'. + +This is intended to provide a convenient way to bypass Eshell's +own pipelining which can be slow when executing shell pipelines +which move a lot of data. It is also useful to avoid +roundtripping data when running pipelines on remote hosts. + +To enable, add this function to `eshell-expand-input-functions'. + +For example, this function expands the input + + !! cat *.ogg | my-cool-decoder >file + +to + + eshell-shell-command \"cat *.ogg | my-cool-decoder >file\" + +Executing the latter command will not copy all the data in the +*.ogg files into Emacs buffers, as would normally happen with +Eshell's own pipelining. + +This function tries to extract Eshell-specific redirects and +avoids passing these to the operating system shell. For example, + + !! foo | bar >># + +will be expanded to + + eshell-shell-command \"foo | bar\" >># + +This function works well in combination with adding +`eshell-restore-unexpanded-input' to `eshell-input-filter-functions'." + (save-excursion + (goto-char beg) + (when (looking-at "!!\\s-*") + (let ((end (copy-marker end)) ; needs to be a marker + redirects) + ;; drop the !! + (delete-region beg (match-end 0)) + ;; extract Eshell-specific redirects + (while (search-forward-regexp "[0-9]?>+&?[0-9]?\\s-*\\S-" nil t) + (let ((beg (match-beginning 0))) + (forward-char -1) ; start from the redirect target + (when-let ((end (cond + ;; this is a redirect to a process or a + ;; buffer + ((looking-at "#<") + (forward-char 1) + (1+ (eshell-find-delimiter ?\< ?\>))) + ;; this is a redirect to a virtual target + ((and (looking-at "/\\S-+") + (assoc (match-string 0) + eshell-virtual-targets)) + (match-end 0))))) + (push (buffer-substring-no-properties beg end) redirects) + (delete-region beg end) + (just-one-space)))) + ;; wrap the remaining text and reinstate Eshell redirects + (let ((pipeline (string-trim + (buffer-substring-no-properties beg end)))) + (delete-region beg end) + (insert "eshell-shell-command ") + (prin1 pipeline (current-buffer)) + (when redirects + (insert " " (string-join (nreverse redirects) " ")))))))) + +(custom-add-option 'eshell-expand-input-functions + 'eshell-expand-to-eshell-shell-command) + (defsubst eshell-kill-new () "Add the last input text to the kill ring." (kill-ring-save eshell-last-input-start eshell-last-input-end)) -- 2.29.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 07 04:17:53 2021 Received: (at 46351) by debbugs.gnu.org; 7 Feb 2021 09:17:53 +0000 Received: from localhost ([127.0.0.1]:46872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8gCX-0002GW-6J for submit@debbugs.gnu.org; Sun, 07 Feb 2021 04:17:53 -0500 Received: from mout.gmx.net ([212.227.17.21]:46649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8gCU-0002GI-MJ for 46351@debbugs.gnu.org; Sun, 07 Feb 2021 04:17:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612689461; bh=kBYyXybfJTGujIUP+XabvU5wXuS8zAEj+aZOi8HbzjE=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=aYg0nScMWrDxfGF1omlTGwEzZpeV4OMnKY1tC3tRF+ztY0DrdGhkKTKNMZM/hn9F6 ejYFHpiCxbE6757lWLuncgqpDvzP9wXGYM3bz+sSy8jHqtKejaYwwRWi8Z/m3Ffm/e seSnTw3pKz0Z9JyH24DkPAv1P02yZx+gm4tlaql0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([178.20.94.105]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Ma20q-1lTbFZ0kiK-00VvEz; Sun, 07 Feb 2021 10:17:41 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <878s812c6a.fsf@melete.silentflame.com> Date: Sun, 07 Feb 2021 10:17:39 +0100 In-Reply-To: <878s812c6a.fsf@melete.silentflame.com> (Sean Whitton's message of "Sat, 06 Feb 2021 13:06:53 -0700") Message-ID: <87eehsz170.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:3D9BpDFhXMiKRCUyou6dlXWDmN/cx+UzIGwhHHN/1Mgu/coJW6q Qb60jvGbf4QS64+H9XZlBjPIhQ8vx5qNHQZYPKJnoYdn8KS8M4Iu3SQSwsYBfyrdQSNUWB8 pMIHvipTO9aP1R4L41GaxIEuPfXNVzvWkDu+alP3/D3IIanbcgFPDPBCGrrbZ8V+YHFrLgC D0YA3wJkLT9NQErH+ROPA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:6mVKEQ8ht3k=:4QkjRb2CmWuTZ/Gb7y8snJ SEy8GxDcqrkt8vTMvmbyj6vZo/c6XbFBSxUJe3k6HkehEBcKJOLrSMkL4ECUoZiBnQ3Wv0vzV +m0Hq7LXgOrLVbUyNLYP8noSWcm2C+SaqEIn3Sf4pHff/wyeC6ePIb49bnFz8Jy0h8KC7ACx5 RSNANzPUD5r+nEZ8rgNxnsQuDPvfQ7CiT1aR5DE9VxjOmWy6lbUG9PgS/MlFev8zyGAmBHyb8 jZFb4HWApG1VOe7hqIyDgp3tlyf8/SI3SLSSuPL/+TNpeL9eG6AwlFjor704ZWBiF4qSOeLM5 qpxrIERN1UOI6WcMqzHCdC6r1hlhslEvIcuEFn6ozMgfNtUd1AuebcdtpE8muAC233BQftA6p CxMN0MmdeVYsUodRm2vzSFiYLibJ13Pn3IxPcBbNHDu+tTyKUW+ZCgR7dIMsSQspzDTxDx9RF ySXyh6NTJbtog5I0sMkB8B6hLaYP6C2qYtdKMuyyWCNLqhhYtSyBdpBEgKmm5RMhHIVqkky1f 0QsXjFtn4I/pSKJIfQ0FOs5BmXaSx70QZwXxZe752RzdUV9syjKA0J824yZYW4lRhYZuLtjgQ iOhGtHTM4kszI9gtZzvylQJr1njDjOcTq/e2hXyxppNHlFWOhbmmuMHJ9a85D9n00E5nVr8sX /khj1TPfDwn5z8a1fLRS0+Rp/7UdkwEOLt9AIw/wKhDMEG3UkbtS3kOUTnk1JJKtEonR/737d brXCKsU1A8Jab/SLaAixiInUOUM56PS3cvltuEWqnXpqmPNBvo1y1IMxlt6TaM3b/I+rMnKT0 oF0inHathM5HNcjp5ZhuPlxb8cqdS/GuZAtfyjre57WAFFkeSQXMzPn1R4CFtrP53OPNBJ9u2 OHpIC2bdHhGQi+G5ewuQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Sean Whitton writes: Hi Sean, > I think that it would be good to have a way to easily toggle Eshell's > own pipelining support on and off for particular commands. I have come > up with the attached patches. When the new functions I've defined are > enabled, you can type > > !! foo | bar 'arg' >baz >># > > and it will be executed by Eshell as if you had typed > > bash -c 'foo | bar '"'"'arg'"'"' >baz' >># > > The idea is that you can easily toggle Eshell's pipelining on and off as > appropriate to your needs just by adding and removing the "!!" prefix. Nice idea. > I think that the patches I've prepared are a clean implementation of > this feature that would be good to include in Emacs. Applying your patch, I get the compiler warning --8<---------------cut here---------------start------------->8--- ELC eshell/esh-mode.elc In end of data: eshell/esh-mode.el:1114:1: Warning: the function =E2=80=98(setf buffer-subs= tring)=E2=80=99 is not known to be defined. --8<---------------cut here---------------end--------------->8--- And using it in eshell, there is --8<---------------cut here---------------start------------->8--- ~/src/emacs $ !! cat ~/.emacs | grep albinus !!: command not found --8<---------------cut here---------------end--------------->8--- I wanted to see, whether this works also for remote directories. Have you tested this? > Sean Whitton Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 07 14:01:14 2021 Received: (at 46351) by debbugs.gnu.org; 7 Feb 2021 19:01:14 +0000 Received: from localhost ([127.0.0.1]:48805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8pJ3-0006qa-V2 for submit@debbugs.gnu.org; Sun, 07 Feb 2021 14:01:14 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:33571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8pJ1-0006qM-7F for 46351@debbugs.gnu.org; Sun, 07 Feb 2021 14:01:12 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id F1B1BBEC; Sun, 7 Feb 2021 14:01:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 07 Feb 2021 14:01:05 -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:content-transfer-encoding; s=fm2; bh= l4TucaqnSeQL34nI/CzS5SIgXJyUcBefPZGO3Ierqes=; b=Hy/T9ZzxNCMBsAoE JYNZnjCW7VU3HXFqdwjAhkj/ctu4ePAPza0Iep9RwO14VGn5w68+oieStpH7RQXh VdfJ2yWzulSEE5fIN3FRARvF+Gj4WDQsNS1W9KW+ESZeAjawY58JYZOwc4klK7Ac NYggbYRvlxyIF3pqpMCgD2fAfBk/08dwdr5KyPCL59pMjCX8lENkzc2iJQnbrGUM K89oLRqDLT4uRTqXB7KxLXMHUqCc88mCNASaak5tuA0leik9HQwoV0tDRRORnBA/ JlcHhTrY5Bwz/zaWRYJG/nLlgIXZcjp+Tucu51aOqJ9UsOP83S0PPnXIGdkeweyO Y0oCgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=fm2; bh=l4TucaqnSeQL34nI/CzS5SIgXJyUcBefPZGO3Ierq es=; b=hWNeVHeY3rlw1Ywy3lgIDxLxfOqZ1tNvT3hhj8hpFqzkH/e8XwGDfaDUM KBUR4MwtatJOggL7/Pet1sMHh9+v0/x5AbfiUBjF0mlWQ1hORSdP9oYmJhE+WAof lc3p9JOvP9SHRcbtFoBqG5yoS5XB5k1NZCFB69HFGT9J1ARSFifkYtG/TkqapeBp yDVudeTgqCyyZXM2EJFsbDzEcMdAbx+X1qHfy8Db7XBkeaotlucOlIExLMTE1CjP eOwB2wqxT74ihUA9CIa1Ca11wsWY7mYFs1zC3an7yNQ7IRlFIjN1fYRtkquY+f3D EW43lzYBhK8ZWcO7JaEvbc4R5Lz8A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedugdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepvdfgkeevtdetvedvhffhgeevleelfeekveeuveehffduvdei udfhgeelvefghfehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: From: Sean Whitton To: Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87eehsz170.fsf@gmx.de> References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> Date: Sun, 07 Feb 2021 12:01:58 -0700 Message-ID: <874kin1z2x.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sun 07 Feb 2021 at 10:17AM +01, Michael Albinus wrote: > Applying your patch, I get the compiler warning > > --8<---------------cut here---------------start------------->8--- > ELC eshell/esh-mode.elc > > In end of data: > eshell/esh-mode.el:1114:1: Warning: the function =E2=80=98(setf buffer-su= bstring)=E2=80=99 is > not known to be defined. > --8<---------------cut here---------------end--------------->8--- Hrm, I can't reproduce this, but looking at the docs, I think that the problem is a missing (require 'cl-lib). Would you mind seeing whether that eliminates the warning at your end? > And using it in eshell, there is > > --8<---------------cut here---------------start------------->8--- > ~/src/emacs $ !! cat ~/.emacs | grep albinus > !!: command not found > --8<---------------cut here---------------end--------------->8--- You need to add eshell-expand-to-eshell-shell-command to eshell-expand-input-functions and (optionally) eshell-restore-unexpanded-input to eshell-input-filter-functions. Or maybe (the first of) these should be added by default? What do you think? For testing you can type these forms into an Eshell buffer: (add-hook 'eshell-expand-input-functions #'eshell-expand-to-eshell-shell-co= mmand nil t) (add-hook 'eshell-input-filter-functions #'eshell-restore-unexpanded-input = nil t) > I wanted to see, whether this works also for remote directories. Have > you tested this? Yes, I have, and it works (I did cat largefile >file and confirmed it's much faster when prefixed with !!, of course because the data doesn't get copied to the local machine). --=20 Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 08 05:29:10 2021 Received: (at 46351) by debbugs.gnu.org; 8 Feb 2021 10:29:10 +0000 Received: from localhost ([127.0.0.1]:49884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l93n4-0000To-75 for submit@debbugs.gnu.org; Mon, 08 Feb 2021 05:29:10 -0500 Received: from mout.gmx.net ([212.227.15.18]:33537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l93n1-0000TL-Cb for 46351@debbugs.gnu.org; Mon, 08 Feb 2021 05:29:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612780138; bh=hArfY/KOVJcMV8YV/34usUfGhJDpUmeXmjRCg1OTBLQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=RFzfoi/mvWSLOCEev8EtvAdkZg52VU5NMjKjswmj/KtZNFknijlabvCx80PVMMfeZ awkkXyeKSFSE3rbe8/XuV5smhilyay0ocXNnhP/ZGjoHNqozNK7V6VrrApB6458iiA A17hIOXTPg9jYiDrkhTPFUoN6SPL7Y6q8YMLCtMg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([178.20.90.93]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MCbIn-1l0ZKL2Syx-009jJr; Mon, 08 Feb 2021 11:28:58 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> Date: Mon, 08 Feb 2021 11:28:54 +0100 In-Reply-To: <874kin1z2x.fsf@melete.silentflame.com> (Sean Whitton's message of "Sun, 07 Feb 2021 12:01:58 -0700") Message-ID: <87ft26etuh.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:aH4/yFrfnH80dbrTcPdUDnZG9jPzogwwW20cEL+mbKY3OdbuLS+ 5SYUwClQr33AIfrhTjzfIPBqVuW9Ow4MfssmUIaq/f9NAp/lxP3i4dOtrcv/vmDX+BBzHvj 6cRVPqTNCMW0hFtuvkC5wehXVWWKWxu7ZY5ygSmOgi11bBiJNLB1Dc2FlfzIH5CUgWlv35q to9NpQ8ZpnqrBDLeEDy9A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:jg9cYuyiQXM=:mf3/566p2jbGew9GX63EXq IXvsbfpXzBQcqX9sptd/xObbVALR0STL/hcD8ipwn7qMXGNE8oA8NkN8hudW63xty9AYSzEO8 po/hd3zAz5p1k7XlgizWOPXvgnOCr8brIAfYvjp+SpGVa6z8eUovuo6pgw4OI/NuwvwHnglmG 6m+7d98vnv5ycd3nrb82NwDyzRwsDjPtZ0G+2HdOqnMcSijhMo5lFUJ8q7EcChgTgCIuZUws9 QBd8U6xv9+TQNXg0dBQZj759jR8XSHh3UmDip98xeuugRNp5UnQPhZA3tevIrupTNedjjjcYM JtNuG+FtjZt1/WX5kpiWtm6erk6jzYwlroEILQrz7Zm3OZ+jGC5ozow7rifByL4jotu13lKeg pk3fzLn2ZAVdlPLCxeFCQLzyg5qm10wvcp3xKaW6I7yMJclmlvho0tvTzAqvGyxTAE7Q5hxAG mqn9XgezkTAvYWkst8wAcWXFxG+tlPshz6XcksaOJd+UF5k9D9H7O4Uf833R8wEcSXa2/Piz2 5+dyrIs2oXSl+5Q2cs0ulf1wJFyOrCe1mgsisM9nvEu4E23fzCWAWO+kDllMoevx5ulyqz5JJ dYXyF5lr6rsBZ4DwRq3ogIdUj2YnVT3IBzoX/h9Jy1GIZ2ZVuNcvSAA6POwmFLXSccYNGCbV+ elTzCKo/FG58R8D2OY/rQrbvUSO7Dq/+QPnjlt6nka47UExvG5Bt66EQrZHLn3Z66poGNMadU eAxBwvnh0Iq49TMabzx6pgX49LwwR7VAxj9pds2WXojgijHrdB2hmpCTQOCIahSzh9ZtcLf+N 8mgQw/zHKRqMkpcSGNwg38f2sdeB2P80CwIJGfWCWR+cdaq3uRyFom5r6ZwWulv+wXG0Ng7Ct 4dXNDH9DV3CX3k51V0Gg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Sean Whitton writes: Hi Sean, >> Applying your patch, I get the compiler warning >> >> --8<---------------cut here---------------start------------->8--- >> ELC eshell/esh-mode.elc >> >> In end of data: >> eshell/esh-mode.el:1114:1: Warning: the function =E2=80=98(setf buffer-s= ubstring)=E2=80=99 is >> not known to be defined. >> --8<---------------cut here---------------end--------------->8--- > > Hrm, I can't reproduce this, but looking at the docs, I think that the > problem is a missing (require 'cl-lib). Would you mind seeing whether > that eliminates the warning at your end? Yes, that helps. >> And using it in eshell, there is >> >> --8<---------------cut here---------------start------------->8--- >> ~/src/emacs $ !! cat ~/.emacs | grep albinus >> !!: command not found >> --8<---------------cut here---------------end--------------->8--- > > You need to add eshell-expand-to-eshell-shell-command to > eshell-expand-input-functions and (optionally) > eshell-restore-unexpanded-input to eshell-input-filter-functions. Or > maybe (the first of) these should be added by default? What do you think? > > For testing you can type these forms into an Eshell buffer: > > (add-hook 'eshell-expand-input-functions #'eshell-expand-to-eshell-shell-= command nil t) > (add-hook 'eshell-input-filter-functions #'eshell-restore-unexpanded-inpu= t nil t) That works. Maybe we could add it to the defaults. But at least I would like to see it documented in the eshell manual, otherwise nobody will know the effect of "!!". And I have the impression, that the eshell history is not preserved any longer, when I have applied these settings. >> I wanted to see, whether this works also for remote directories. Have >> you tested this? > > Yes, I have, and it works (I did cat largefile >file and confirmed it's > much faster when prefixed with !!, of course because the data doesn't > get copied to the local machine). It doesn't work for me. The reason is a little bit subtle: you use `shell-file-name' in order to call a remote shell. In my case, it is "/usr/local/bin/tcsh", which doesn't exist on the remote machine I've used for testing. Maybe you can base your implementation on `shell-command'? This should know, how to handle a connection-local `shell-file-name'. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 08 13:06:43 2021 Received: (at 46351) by debbugs.gnu.org; 8 Feb 2021 18:06:43 +0000 Received: from localhost ([127.0.0.1]:51882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Avr-00066X-6n for submit@debbugs.gnu.org; Mon, 08 Feb 2021 13:06:43 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Avn-00066J-TD for 46351@debbugs.gnu.org; Mon, 08 Feb 2021 13:06:41 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9C3E65C00A5; Mon, 8 Feb 2021 13:06:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 13:06:34 -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=PnCmSK4KQgeHcrnVYPJDF5f6+q 0AshVucaHzKd1vqTU=; b=mDH8KTUZFtsHrT4mMHjhA8zNwKWYFqlX2tllJmMLXV eukVXF1IpAm+LmEoc/33QgyuPcUkpFHPHdmVYO1wGa/DDmdEVoYkcSSqO8wDRayC 84XhvcHSnSH6uRDj6H7EqTH4aAwYsQdJX1/aZSc4jdDL6d0nwwSWBXOD89Lax4O0 r520LRgnYC3LndmS3Tq9c91MIcD2faszwGZrT78OEvfZ9yVx5b7V0z72+F9S3KDh cHrPdwKv1oNhpPLbWCIEUt1pjzKf1Zg3ndyyxAChdiY9Qs/QyDHCRjEnXyGB0Amh 7J+arjGd3ioEsmvIolvwryxux1JD3E8ZEIZvaBdauChg== 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=fm2; bh=PnCmSK 4KQgeHcrnVYPJDF5f6+q0AshVucaHzKd1vqTU=; b=hzfFLNqIpRJ6QvzLW7Y+G0 NIqLdrL+8mf0wWp2T8m47eEbISQ4WqCEZH0TYyQas/FxiaGAuYEtH5Po4Tv2Ae/K IgqfPO6pYW2MpsnhfWLLKbHam0h21+vBbAuLQGrHhhZEod1/2xtY6xqWG6OrjG8Z ZEFI7MAts9d7XE+HdammEDiHHFRobHlWHBEvCf7RLhlw6ZTIQud3s1BbR/j7e561 0o+lTpDOEkwZKFJaqbzSspazeKv55uV2TJtK/7WGggKN3/1rwaqaAY5boDakYuME a4uIThQkhGW+9lLK1EcQJ7LxBOOW23tVJqqvM1P+CkCEq+/DJBE9+VMaWsMh0rew == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheefgddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgesthdtredttddttdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeegtddvheegfffhffdvfeefhffgjefflefhteevffffkeetgfdt jedtiedvtdevheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: From: Sean Whitton To: Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87ft26etuh.fsf@gmx.de> References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> <87ft26etuh.fsf@gmx.de> Date: Mon, 08 Feb 2021 11:07:30 -0700 Message-ID: <877dnizb4t.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Mon 08 Feb 2021 at 11:28AM +01, Michael Albinus wrote: > Sean Whitton writes: >> >> Hrm, I can't reproduce this, but looking at the docs, I think that the >> problem is a missing (require 'cl-lib). Would you mind seeing whether >> that eliminates the warning at your end? > > Yes, that helps. Thanks, I will add it. > That works. Maybe we could add it to the defaults. But at least I would > like to see it documented in the eshell manual, otherwise nobody will > know the effect of "!!". I was waiting to document it in the manual based on what others thought the defaults should be. If neither hook is added by default then I think the docstrings of the functions that I've already written are adequate documentation. What do you think about adding only the eshell-expand-input-functions hook by default, versus adding both of them? I think that adding both is probably most useful to most people, but it has the potential to break existing uses of eshell-expand-input-functions in people's configs. I'll look into your other points, thank you. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 10 06:33:55 2021 Received: (at 46351) by debbugs.gnu.org; 10 Feb 2021 11:33:55 +0000 Received: from localhost ([127.0.0.1]:55593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9nkp-0003S4-Dv for submit@debbugs.gnu.org; Wed, 10 Feb 2021 06:33:55 -0500 Received: from mout.gmx.net ([212.227.15.15]:33515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9nkl-0003Rp-RR for 46351@debbugs.gnu.org; Wed, 10 Feb 2021 06:33:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612956822; bh=RE5pQf4LZ6b0th5G/BtOFsI5ndeTnMMQtCBTsUDn/h4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=MloLa3uvekUxYhH7o3JgqJYnEPgfDn2RmmPmym6muZM8MW/ubO0HnFQ2XZAZDQCs8 tWhy9c6DVEgoyREzSrECKEL6DW1tZbZESfeiLNiCxQ6OQPrPSksyS5oxlE6DD25ivu 1bOJg2h6hv2ExrwW01JrW2Hxk0plqccf6B+84jVU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.117.252]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MGhuK-1l4uCl3biE-00DlKb; Wed, 10 Feb 2021 12:33:41 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> <87ft26etuh.fsf@gmx.de> <877dnizb4t.fsf@melete.silentflame.com> Date: Wed, 10 Feb 2021 12:33:40 +0100 In-Reply-To: <877dnizb4t.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 08 Feb 2021 11:07:30 -0700") Message-ID: <87y2fwcg2z.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:XEhctSqB9JvlWvJS+TWVWGcxrWtgPii0Ch0sWY0pCjfsumhQtG8 yfUSdED8OnRTax2+vEkH07mygfZ2A0FD5ixA4JvE1O+xEvzeqpgWQv8Na9Y/k53LCh94S2u Z+KP2nfc+By/HQikdFKQq+IJOLT7dolMdy5c9pLkkJfyvZdzTipc+RUt1ff67592xKHE4M+ bx9xOtVbfnMaeWaxvNhvg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:55Ob/gkYaGE=:XXPnWfu8SdkCvE4I1FY6bG ihqF2tsWJe7FEe7+BcT4ve272OTk3SWmSGdPw5LfsVWc0/4wwUHbF4CSwrymWAT2Uijt8gasF 1lh0zJhL2NzkowPT4lHdFsJW0Y/qfqUd9Rw2hL/pUboUT5f6l2hN1jJ2i9+6Exma2YI9xFaes o1JX7/hu9aUMtVLhRr6wiHYIVevBAfaLAMNU1KWbdu2Awk0XsylR+PtF3cFVOuQpvclGg9Aj1 kX00zbrFmUPsosREru7BJMYtzogIURKmvEOipJHCK6gQkWto3+XmPHwDAELiWDQOGfL5LaSCU /Z+YYHVat04VdFtVBp6x4SRGRpmv0kqS9+hRkNPTcFduyDQgVRyIZAIjXcArkwSU3zLgNx+xN bZPeVYidqidYjqRf2icdOPzzg+Qb31pUvPF6xd+XfICOzuN/kmlbCEU7AGLWfbySWfHtOYTTK rday3vz3L4Sj1kG/iGosnkMsiK3+eNkXg54XSujeS2Me1Vdud26zIfxvMwjp/T2OMOU1hXFBM PErAdsOLFKaXp5ACQvcouSC5fAB0GRQrdgbbe9BuFqRtrLvJ6NEvT7d3Rz8voSTv55J8KMKNs 0QVxmfDp0Vkv2kTbC5pU2QKxY1uqIyCN5hddxP0F3BNnEN6uexl+o6xzi80knW1jNbyLch5A6 1bghucyb5aSRfqaPCogH62Mllt/2zMx5QrV5ozuB92rSvzl6lCo0yUQdDt6qLSMll3pRWPO/D 76TDEuG8L+BSJMBeH1Mr0qaDP5VIKPYfRtfaJ+iMORprbTcGp8HfISAtfhe+m18ZW72vejGQH VerUG3J456o2u8GTfFA62Qj5D15JkVMroT/daOWDvtDQrgtY4jpPKdLvj1UzayR6UvswLrZ42 I2PGRWbEY5K3A/uiYaKA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Sean Whitton writes: > Hello, Hi Sean, >> That works. Maybe we could add it to the defaults. But at least I would >> like to see it documented in the eshell manual, otherwise nobody will >> know the effect of "!!". > > I was waiting to document it in the manual based on what others thought > the defaults should be. If neither hook is added by default then I > think the docstrings of the functions that I've already written are > adequate documentation. Sure. But the manual needs an explanation of "!!". > What do you think about adding only the eshell-expand-input-functions > hook by default, versus adding both of them? I think that adding both > is probably most useful to most people, but it has the potential to > break existing uses of eshell-expand-input-functions in people's > configs. Honestly, I'm not a heavy eshell user, so I don't know whether it will disturb people. If you don't feel comfortable with these changes by default, you might move them to an own eshell module, people would load if they like. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 24 16:20:39 2021 Received: (at 46351) by debbugs.gnu.org; 24 Dec 2021 21:20:40 +0000 Received: from localhost ([127.0.0.1]:38166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n0rzT-0002Q2-9i for submit@debbugs.gnu.org; Fri, 24 Dec 2021 16:20:39 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n0rzO-0002Pj-20 for 46351@debbugs.gnu.org; Fri, 24 Dec 2021 16:20:37 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B31925C003B; Fri, 24 Dec 2021 16:20:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 24 Dec 2021 16:20:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm1; bh=0PT3cYT6OFZIVtOBz/d1QmmLaF 8nr7QJvE4qpPXmZzk=; b=ETAa71HWPQqJa+ROhAYlX/5rD+MOYElDPkwGDrL9pz 6k2kdr1TSgjGqZeFyaQErnPpiu4yhwtuFoULySMt3nCY6aBP7qZEVIzUVsCMIA/y aPVoEByN0tmrNUewpsyQZu6eE7V/voBzJ24VjuGsEkHsepJN60/L5CYytiKQ4yzy kVQXddqxL1OxMUMuPOgO+de3vaVhKw52/52A748u1QUbk+ApkbFYGwyjWEA2Y65F Sa390B0nN16Hdf08j0WvOusgCx5pUU9Jzs1YGysejnxGmSlYfof3capIYSZcN819 1ZlkW2SHg8eLXjLZRQzTm4Tm1dPW0FJvxPYTAMxXi8vA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=0PT3cY T6OFZIVtOBz/d1QmmLaF8nr7QJvE4qpPXmZzk=; b=KDyEz2HaCWsmbdxZyIIoBA xqnElPObJCU/SQHO3TNt2vNVfSsKcte1zmkFJeTpItja48rNx2HNcbq9WsX2jcRN wegvUqDdsiP8EP6UWjY4Wg9orUtLYpxwdHRMz/rfHWT6K4FE+ECorbB4Vv3rd1ZL hJQ62psl0YVFS0d9iyl4zOgml9Tl3ovT/gUljJE2yzUWP5ZY/oyy0xRcT85rHHdN 3FcByvQJJd4EW14oT+hemGmZxcR+q7/TXzJBsRareS5EJ9y1ck4vgEdYJTQdZNA4 pcCZAUIkKk6tz18MbcPYV1WSkYsGZmw72W1bqCYYYHNjBeT7fTST7vb137cTIp5A == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddutddgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfet vdfghfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Dec 2021 16:20:28 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 5EAF77F3128; Fri, 24 Dec 2021 14:20:27 -0700 (MST) From: Sean Whitton To: 46351@debbugs.gnu.org, Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87ft26etuh.fsf@gmx.de> References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> <87ft26etuh.fsf@gmx.de> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Fri, 24 Dec 2021 14:20:27 -0700 Message-ID: <87tuex1yzo.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Mon 08 Feb 2021 at 11:28AM +01, Michael Albinus wrote: > Maybe we could add it to the defaults. But at least I would > like to see it documented in the eshell manual, otherwise nobody will > know the effect of "!!". I'm attaching new patches which - switch !! to ||, because !! in shells typically has something to do with rerunning the last command - activate the syntax by default -- I do use Eshell regularly myself, and I don't believe that activating it by default is likely to disrupt anyone's usage - adds a section to the Eshell manual introducing the new syntax. > And I have the impression, that the eshell history is not preserved any > longer, when I have applied these settings. I have not been able to reproduce this -- can you confirm? > It doesn't work for me. The reason is a little bit subtle: you use > `shell-file-name' in order to call a remote shell. In my case, it is > "/usr/local/bin/tcsh", which doesn't exist on the remote machine I've > used for testing. I was able to fix this by using `with-connection-local-variables'. Thank you for pointing out the problem. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-Add-eshell-restore-unexpanded-input.patch >From d47446cbe7db5c7fb4eba71ab022cfae3de07799 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 6 Feb 2021 00:01:50 -0700 Subject: [PATCH v2 1/2] Add eshell-restore-unexpanded-input * lisp/eshell/esh-mode.el (eshell-send-input): Store the original input before running eshell-expand-input-functions. * lisp/eshell/esh-mode.el (eshell-restore-unexpanded-input): Define new function and register as a customization option for eshell-input-filter-functions. --- lisp/eshell/esh-mode.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index cae5236d89..87166ef3bf 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -62,6 +62,7 @@ (require 'esh-module) (require 'esh-cmd) (require 'esh-arg) ;For eshell-parse-arguments +(require 'cl-lib) (defgroup eshell-mode nil "This module contains code for handling input from the user." @@ -197,6 +198,7 @@ eshell-first-time-p ;; byte-compiler, when compiling other files which `require' this one (defvar eshell-mode nil) (defvar eshell-command-running-string "--") +(defvar eshell-last-unexpanded-input nil) (defvar eshell-last-input-start nil) (defvar eshell-last-input-end nil) (defvar eshell-last-output-start nil) @@ -641,6 +643,7 @@ eshell-send-input (progn (setq input (buffer-substring-no-properties eshell-last-output-end (1- (point)))) + (setq eshell-last-unexpanded-input input) (run-hook-with-args 'eshell-expand-input-functions eshell-last-output-end (1- (point))) (let ((cmd (eshell-parse-command-input @@ -674,6 +677,23 @@ eshell-kill-new (custom-add-option 'eshell-input-filter-functions 'eshell-kill-new) +(defun eshell-restore-unexpanded-input () + "Restore the input text before `eshell-expand-input-functions' ran. +Useful when you want to see the unexpanded input rather than the +expanded input in the Eshell buffer, and when you want later +entries in `eshell-input-filter-functions' to use the unexpanded +input." + (setf (buffer-substring eshell-last-input-start + (1- eshell-last-input-end)) + eshell-last-unexpanded-input) + ;; We have to move point for compatibility with smart display. + (save-excursion + (goto-char eshell-last-input-end) + (eshell-update-markers eshell-last-output-end))) + +(custom-add-option 'eshell-input-filter-functions + 'eshell-restore-unexpanded-input) + (defun eshell-output-filter (process string) "Send the output from PROCESS (STRING) to the interactive display. This is done after all necessary filtering has been done." -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0002-Add-eshell-shell-command-and-eshell-expand-to-esh.patch >From 98df5163018b9c99ad8e65f03422f908c6068c78 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 6 Feb 2021 00:48:32 -0700 Subject: [PATCH v2 2/2] Add eshell-shell-command and eshell-expand-to-eshell-shell-command * lisp/eshell/esh-mode.el (eshell-shell-command, eshell-expand-to-eshell-shell-command): Define new functions. Register eshell-expand-to-eshell-shell-command as a customization option for eshell-expand-input-functions, and add it by default. * etc/NEWS: * doc/misc/eshell.texi: Document the new syntax. --- doc/misc/eshell.texi | 35 ++++++++++++++++++ etc/NEWS | 9 +++++ lisp/eshell/esh-mode.el | 79 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 122 insertions(+), 1 deletion(-) diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index a87dd4308c..7e9233c09e 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -875,6 +875,7 @@ Expansion @menu * Dollars Expansion:: * Globbing:: +* Running Shell Pipelines Natively:: @end menu @node Dollars Expansion @@ -945,6 +946,40 @@ Globbing The GNU Emacs Manual}.} groups ``eshell-glob'' and ``eshell-pred''. +@node Running Shell Pipelines Natively +@section Running Shell Pipelines Natively +When constructing shell pipelines that will move a lot of data, it is +a good idea to bypass Eshell's own pipelining support and use the +operating system shell's instead. This is especially relevant when +executing commands on a remote machine using Eshell's Tramp +integration: using the remote shell's pipelining avoids copying the +data which will flow through the pipeline to local Emacs buffers and +then right back again. + +To quickly construct a command for the native shell, prefix your +Eshell input with the string @code{||}. For example, + +@example +|| cat *.ogg | my-cool-decoder >file +@end example + +Executing this command will not copy all the data in the *.ogg files +into Emacs buffers, as would normally happen with Eshell's own +pipelining. + +As this feature is implemented as an expansion, your original input +will be replaced with something like this: + +@example +eshell-shell-command \"cat *.ogg | my-cool-decoder >file\" +@end example + +This makes it clear what Eshell is doing, but has the disadvantage of +being harder to edit, especially for complex pipelines with a lot of +quoting. If you would prefer that the @code{||}-prefixed input be +restored, customize the variable @code{eshell-input-filter-functions} +to include the function @code{eshell-restore-unexpanded-input}. + @node Input/Output @chapter Input/Output Since Eshell does not communicate with a terminal like most command diff --git a/etc/NEWS b/etc/NEWS index 57fe40c488..767763098b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -749,6 +749,15 @@ the Netscape web browser was released in February, 2008. This support has been obsolete since Emacs 25.1. The final version of the Galeon web browser was released in September, 2008. +** Eshell + ++++ +*** New feature to easily bypass Eshell's own pipelining. +Prefixing commands with '||' causes them to be executed using the +operating system shell, which is particularly useful to bypass +Eshell's own pipelining for pipelines which will move a lot of data. +See "Running Shell Pipelines Natively" in the Eshell manual. + * New Modes and Packages in Emacs 29.1 diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 87166ef3bf..04680e4305 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -63,6 +63,7 @@ (require 'esh-cmd) (require 'esh-arg) ;For eshell-parse-arguments (require 'cl-lib) +(require 'subr-x) (defgroup eshell-mode nil "This module contains code for handling input from the user." @@ -105,7 +106,8 @@ eshell-send-direct-to-subprocesses "If t, send any input immediately to a subprocess." :type 'boolean) -(defcustom eshell-expand-input-functions nil +(defcustom eshell-expand-input-functions + '(eshell-expand-to-eshell-shell-command) "Functions to call before input is parsed. Each function is passed two arguments, which bounds the region of the current input text." @@ -671,6 +673,81 @@ eshell-send-input (run-hooks 'eshell-post-command-hook) (insert-and-inherit input))))))))) +(defun eshell-shell-command (command) + "Execute COMMAND using the operating system shell." + (throw 'eshell-replace-command + (with-connection-local-variables + (eshell-parse-command shell-file-name + (list shell-command-switch command))))) + +(defun eshell-expand-to-eshell-shell-command (beg end) + "Expand Eshell input starting with '||' to use `eshell-shell-command'. + +This is intended to provide a convenient way to bypass Eshell's +own pipelining which can be slow when executing shell pipelines +which move a lot of data. It is also useful to avoid +roundtripping data when running pipelines on remote hosts. + +For example, this function expands the input + + || cat *.ogg | my-cool-decoder >file + +to + + eshell-shell-command \"cat *.ogg | my-cool-decoder >file\" + +Executing the latter command will not copy all the data in the +*.ogg files into Emacs buffers, as would normally happen with +Eshell's own pipelining. + +This function tries to extract Eshell-specific redirects and +avoids passing these to the operating system shell. For example, + + || foo | bar >># + +will be expanded to + + eshell-shell-command \"foo | bar\" >># + +This function works well in combination with adding +`eshell-restore-unexpanded-input' to `eshell-input-filter-functions'." + (save-excursion + (goto-char beg) + (when (looking-at "||\\s-*") + (let ((end (copy-marker end)) ; needs to be a marker + redirects) + ;; drop the || + (delete-region beg (match-end 0)) + ;; extract Eshell-specific redirects + (while (search-forward-regexp "[0-9]?>+&?[0-9]?\\s-*\\S-" nil t) + (let ((beg (match-beginning 0))) + (forward-char -1) ; start from the redirect target + (when-let ((end (cond + ;; this is a redirect to a process or a + ;; buffer + ((looking-at "#<") + (forward-char 1) + (1+ (eshell-find-delimiter ?\< ?\>))) + ;; this is a redirect to a virtual target + ((and (looking-at "/\\S-+") + (assoc (match-string 0) + eshell-virtual-targets)) + (match-end 0))))) + (push (buffer-substring-no-properties beg end) redirects) + (delete-region beg end) + (just-one-space)))) + ;; wrap the remaining text and reinstate Eshell redirects + (let ((pipeline (string-trim + (buffer-substring-no-properties beg end)))) + (delete-region beg end) + (insert "eshell-shell-command ") + (prin1 pipeline (current-buffer)) + (when redirects + (insert " " (string-join (nreverse redirects) " ")))))))) + +(custom-add-option 'eshell-expand-input-functions + 'eshell-expand-to-eshell-shell-command) + (defsubst eshell-kill-new () "Add the last input text to the kill ring." (kill-ring-save eshell-last-input-start eshell-last-input-end)) -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 25 07:02:17 2021 Received: (at control) by debbugs.gnu.org; 25 Dec 2021 12:02:17 +0000 Received: from localhost ([127.0.0.1]:38597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n15kf-0001rT-BR for submit@debbugs.gnu.org; Sat, 25 Dec 2021 07:02:17 -0500 Received: from quimby.gnus.org ([95.216.78.240]:50622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n15ke-0001rD-6k for control@debbugs.gnu.org; Sat, 25 Dec 2021 07:02:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EVF4DK2C0JdbuDezu2kmJ+wYQzYBsmkUsaQafHDQAe4=; b=dflz57+qZGwyyGnbosfjw8gv7N SiwcZm4f0luBPOSw7vtuhvII7hJ1OJ/axvlupU2EhG/P8WwMJKXh3UEtnR9h/DFuSQyOeUy2mpxiH Jhp0T40NOUxqnBNI/+D8dIGqifK/PuW43X4HmINWuipZkh1/jQ6GdtTUJ6nZhT4Bn4vA=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n15kW-0003XW-AV for control@debbugs.gnu.org; Sat, 25 Dec 2021 13:02:10 +0100 Date: Sat, 25 Dec 2021 13:02:06 +0100 Message-Id: <87zgoozydd.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #46351 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 46351 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 46351 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 25 08:51:46 2021 Received: (at 46351) by debbugs.gnu.org; 25 Dec 2021 13:51:46 +0000 Received: from localhost ([127.0.0.1]:38692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n17Sc-0001BT-3X for submit@debbugs.gnu.org; Sat, 25 Dec 2021 08:51:46 -0500 Received: from mout.gmx.net ([212.227.17.20]:38015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n17SW-0001B7-QG for 46351@debbugs.gnu.org; Sat, 25 Dec 2021 08:51:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640440291; bh=rR9cDY55qwuyDUCmDaxNewiJyIumqT5Jf6hFOnD9h0U=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=VBkexGR1ybcX4D16TigNdazGo8FUnmDZq0/K/uF0/nJYD7et22dEW7w8KT8+ytPlM WS5Oc1cx1bmHl8z6UyWWtXzzOYKGwKuO6HPcom9J0PEoUTXCMdKeraCeV12iERnJrW rowRh3h1q8SfonH8J5pu3pi2WCP8Zy/sUQCMsDHA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([212.91.242.110]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MO9z7-1mpwEc18Tx-00OV0T; Sat, 25 Dec 2021 14:51:31 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <878s812c6a.fsf@melete.silentflame.com> <87eehsz170.fsf@gmx.de> <874kin1z2x.fsf@melete.silentflame.com> <87ft26etuh.fsf@gmx.de> <87tuex1yzo.fsf@melete.silentflame.com> Date: Sat, 25 Dec 2021 14:51:30 +0100 In-Reply-To: <87tuex1yzo.fsf@melete.silentflame.com> (Sean Whitton's message of "Fri, 24 Dec 2021 14:20:27 -0700") Message-ID: <87czlkbxnh.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:YMeeq5HUOSuliojmgnmRr5j4zisoLB7FcXC/GfkMM87r8pE2Jsj i92f2RJIfYZ6qNC5EcdN6eTaslAf3Qs8E3pcNgsBEhxLexShBsIc0HPp4GzS74Fq3Lu+s9u gSSIC3O9CX9PpuSFBXrmBD6SF8IyrJkMuCKP3bkU7a87q3OPGE55zcVPJhZP3gXPtYhi+4M 1bu+Ghi8KvONKHsdCiR0w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cxT7b3MdjTg=:Lnhq19gnynDdZLVXluf0yu aMgY8Ewyk4rO1XPoV1EUUkO7KyXtM3Y4mgL82ndo6P8wA6FViu67jBOKQsqWkCG1nYU/x6//q 6ZIreHy/1S1xkM2ia8pcw6MAih6s0ZHpv3dm00EelOeW2Cq41vjlmqVdjVnfvzuENO7avX3UT TZihW8YdKqO2k7U/7ExfTodGYvH905xaco/K9344mz/4fb56Y+gfJTpabzxm2tO8gaPi2AdvG 1mCtSmoMEZJcrPcwIlscrqaI9RaU37zR3TDC0DBSMC1nbgSUctEbiS/OvTlJT0xJDvrUdZFPW O5dVclG99+C5qPEOuIXqebDP6msl3rVYUYSSB0aFBUOGQhd8tR3Ffo6t37GvHDmTB0DR28MXp joAeg61xJgf+xxc7P2ooSIkXW+ZcbpSQ8VC2inxldBORETp1oBtW8DbjqGhGaKq2bYGhgf7gY Zc09xJL6ZFFyKp9FvdTWJDpWrYcrdfx2xca0Ksm9QSrD1IuUlCZvh0V1mqgzVMZzsEcdlC+IX r3cVUHuFozPAov+P2oXvmSnQBDclgcQPwcbn37/xuXPa081MtOJ4L7OCfRw7P24ww6jFSnsW8 iRvcqADe/ivHRF+hVKphCHzidW4sGTKqLW9o5UegJRqDsPFSTBcZrI2nK/yZxPitMNxlNBMbZ JQGYzcn1ygpLvfh382BkvgrSiXCSZbzIX+SF5hArIILLLJZBJ+pl+FMw0ec8k9XfKIKkg9ohu M8urXqYUZ8DFWJhvGvsmFqyQzr3TBzAAhb3vrEP9IwZ/4J1Mm2+NWF7eRZ9G1iyofv5XGkYF8 niBDpaIx/umlyQoma56RCQQtWXbuCp+FCR5R4pLEbuupDxzkK8JtDtFR2bCuuye6WQ1TrLffR 238MVQgDmwqZKrXaes+UZhc1uCml30ojfJmOyWSSJu56q0Ucw1IK/hx0WhoxO4VzcIOe/T+q6 JT5pfxV2/sVvBn2XOwH3jHA0q4MUNtHtRqQOcheYTtN8flmnYMCdafynOjKKmsThbeu7yrMIQ CHtf1oVE+Cy4bsNpMdhbwatqeShtZUH1Im9frXFIc18Krzn32ooZ0F/Rr0XZdfyyHstmi+oRy 3RaNPiP2Kbu9BE= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sean Whitton writes: > Hello, Hi Sean, >> Maybe we could add it to the defaults. But at least I would >> like to see it documented in the eshell manual, otherwise nobody will >> know the effect of "!!". > > I'm attaching new patches which > > - switch !! to ||, because !! in shells typically has something to do > with rerunning the last command > > - activate the syntax by default -- I do use Eshell regularly myself, > and I don't believe that activating it by default is likely to disrupt > anyone's usage > > - adds a section to the Eshell manual introducing the new syntax. Thanks! I've played a little bit with it. >> And I have the impression, that the eshell history is not preserved any >> longer, when I have applied these settings. > > I have not been able to reproduce this -- can you confirm? Yep, the eshell history is there. However, it looks a little bit weird, when I have applied '|| cat .emacs | grep a'. The history shows me 'eshell-shell-command "cat .emacs | grep a"' instead. I understand what's meant, but is this convenient for an occasional eshell user? >> It doesn't work for me. The reason is a little bit subtle: you use >> `shell-file-name' in order to call a remote shell. In my case, it is >> "/usr/local/bin/tcsh", which doesn't exist on the remote machine I've >> used for testing. > > I was able to fix this by using `with-connection-local-variables'. > Thank you for pointing out the problem. This is fixed, indeed. Thinking more about, perhaps we could solve it a little bit differently. Eshell knows how to invoke external commands explicitly, by prefixing the command with a star like '*ls'. What if we do it the same with pipes? That means, '*|' would mean to call an external pipe. So my command above would be 'cat .emacs *| grep a'. And an external pipe shall convert all other commands in that line into external commands as well, like '*cat .emacs *| *grep a'. By this you wouldn't need your restore-unexpanded-input patch any more, yes? WDYT? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 25 17:45:54 2021 Received: (at 46351) by debbugs.gnu.org; 25 Dec 2021 22:45:55 +0000 Received: from localhost ([127.0.0.1]:40014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1FnW-0000NP-KX for submit@debbugs.gnu.org; Sat, 25 Dec 2021 17:45:54 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:50175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1FnU-0000N8-6o for 46351@debbugs.gnu.org; Sat, 25 Dec 2021 17:45:53 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1D9633200E8E; Sat, 25 Dec 2021 17:45:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 25 Dec 2021 17:45:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=oyI2mZtIRK00E6lMyXQ2bKW9C8 kqq1gt2Si/sJwl9yM=; b=gbCqkpNjVtqCzJZln5c15VDz89HLHahU/0z2fQ7ImX sKHX/P3/t+vV+wGwweaYJVKfcPNfujKUO7aEbUhehoMPw0AUDjsxzKHuq7z5ugv2 5yQya9yV2BFs3+vDTjCV/hVyeMRnDZ2zy1Bh/XGqkPbysvXKM5QYxlA9JEofLBiZ W2hUre0MEGpWGsuGaZzehZ19Ptm+/roANfe+mt7fV0X4MqtecIALk+G+6C+MGzz0 eeIf6lAX+0ZMB9YxQJbzbxqGmhvuH9QcD1QLnHJANSZQ5LN/mFVH0Pe5/TKISxrh grEHbNHAx4E7z/XVA6ZnNZw7WE53JqV615HZ+p/q6RAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=oyI2mZ tIRK00E6lMyXQ2bKW9C8kqq1gt2Si/sJwl9yM=; b=EVtjSEgNDouIdhRAMtZ1Nn eN7AT+l/kdLF5C/m3FCDWT2N0sTGVMtA12UJUloMzCILx92DmCizo/Hwlq5Z5tRg Y53DncbukWeTSH9m5FxW4kZ/BlHzMdysnKe4mrV/PR2jEiPe/leC5UcAnLlDUKln 7DKdZz7BQ+1zDlXi7Q5NaDRuMp05FHAEKuxN9cC4Q8JKenVnWZ1HtEgKAqB45GOW PYeJmBkZjAaE1dC1lttzhOASeVtyDmfILphFdY70w2mu+/GbOSHwjQ1Sw2pAO7u3 9i1SogR0nk0AyCxV/3YKW6WE3e2LLDui5U0/b7dXduFboAeL+WOCrRcP9xWhIA6g == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddufecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucghhhhi thhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenucggtf frrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeegfeet gefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Dec 2021 17:45:45 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id F3F8E7F32AD; Sat, 25 Dec 2021 15:45:43 -0700 (MST) From: Sean Whitton To: Michael Albinus , 46351@debbugs.gnu.org Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87czlkbxnh.fsf@gmx.de> 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> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Sat, 25 Dec 2021 15:45:43 -0700 Message-ID: <87ee601ey0.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Michael, On Sat 25 Dec 2021 at 02:51PM +01, Michael Albinus wrote: > Yep, the eshell history is there. However, it looks a little bit weird, > when I have applied '|| cat .emacs | grep a'. The history shows me > 'eshell-shell-command "cat .emacs | grep a"' instead. I understand > what's meant, but is this convenient for an occasional eshell user? Yeah. Actually, when I prepared the first version of this series, the unexpanded version got stored in the history, so I think something has changed about Eshell history recording in the past year. > Thinking more about, perhaps we could solve it a little bit > differently. Eshell knows how to invoke external commands explicitly, by > prefixing the command with a star like '*ls'. What if we do it the same > with pipes? That means, '*|' would mean to call an external pipe. So my > command above would be 'cat .emacs *| grep a'. And an external pipe > shall convert all other commands in that line into external commands as > well, like '*cat .emacs *| *grep a'. > > By this you wouldn't need your restore-unexpanded-input patch any more, yes? This is an intriguing suggestion. It would need to be implemented in `eshell-parse-pipeline, rather than `eshell-expand-input-functions', because parsing is required to determine which *| are unquoted, etc. We also require *> and *< redirections, also in `eshell-parse-pipeline'. So, I guess when A *| B is parsed, it would be rewritten to a single call to `shell-file-name' in the way that `eshell-shell-command' does. I am not sure how feasible it will be to implement that within the existing structure of `eshell-parse-pipeline', but I can give it a try. I have one unresolved design question. A disadvantage of your proposal compared to mine is that it is much more laborious to convert an existing pipeline to use the external shell: you have to replace each | with *| and > with *>, etc., instead of just putting || at the beginning. I think it's important that it is easy to switch this feature on and off, because it is often only after you start figuring out a pipeline that you realise you ought to bypass Eshell's pipelining. One option would be to add an entry to `eshell-expand-input-functions' which converts all | to *| and > to *> when the input begins with ||. But that is too simple, because you need to parse the input to know which | to replace ... any ideas? I don't think it can be done inside `eshell-parse-command'. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 09:43:05 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 14:43:06 +0000 Received: from localhost ([127.0.0.1]:42415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1rDM-0002dh-3H for submit@debbugs.gnu.org; Mon, 27 Dec 2021 09:43:05 -0500 Received: from mout.gmx.net ([212.227.17.22]:42141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1rD6-0002cn-0Q for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 09:43:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640616159; bh=ca/qRAzsaE0C26ohy+R+KZxZSIElRSGFnxrv0V1DMjQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Y1TB/BKHPELAzCa1YFeNY3ROMYFyOWRveMUEm3TBuo2wtQ9F2FFNaon9svJhYDo60 MKENLGWqEmgQ//TMHwC3Aq/OoKPbPSzLFk2rmC2iaVkExAqYuAUwtcqMfSkKIb8wTi XzLOT4A12hYXv8EIkqoo0fHVIS2PseVp7nxvb7h0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.124.170]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MUGiJ-1mtIke04Dj-00RHhg; Mon, 27 Dec 2021 15:42:39 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> Date: Mon, 27 Dec 2021 15:42:37 +0100 In-Reply-To: <87ee601ey0.fsf@melete.silentflame.com> (Sean Whitton's message of "Sat, 25 Dec 2021 15:45:43 -0700") Message-ID: <871r1yaz36.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:yoMOSxhcOBXCTFFHCKMad6r9MOb7vd5TAmSOu8ivSunO8QPaIAL MI5lx6868jfeZJo7uwy6qRk88sTdL8NJkbkYQSMVjsstubLabLZPcYH9Lt2XM7QbOm2a9n2 j5Yt/+olRY0dKNiG+kafq6yYrNZxlbwiC7O3f0DCe9ep4WDFyNBjp5y6vyhCGu+vX3hmM8v th4e9zzc0u4dTXPet8b7A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vkWA/r+Id3Y=:f6Z1MxC+KGpWhSrfjNIq3L NE+a/Jtvoan/L1lb0LrSfBBs1sY65WnEXtiRHsE9xpRSSJTVgSW767m68LkoE4ITHW0C0Cgbi Rgsr8e6bu1R5RPkc24464mduFSAlpG8N2IfAL/94FxOYZl24qU5953uXQgCPYBxo+Qim2/ojY 0VBKE1tD5///ajvAqgGfAoCXzT+AZLOeYmOj5Fm3nZjLPLtQ04s2GwA48KShn+KsMYEI5+/cx nQfXcLdXwhqUqE5nbnyLUrMxfoef9IZUpZeS0QBiMmPtyaT1u/cOH43dldyGa+2y2+QdHCNl8 nKZIkd0OxymlQvgzH81xTidkH/YaVQXTMhYSu61wyVXaucazmgH+23QdAbfj53J4/aadn7Do5 G5dbg6V32aijEMFTFzZs3H525veAqk5Kw49yVt/PSKvFePaLs2UBykM9TN35Oc896AF66Igfo 5Ub+dxBVMtupQE+pSPlkxmnWnG+nmmUx7JGO7wdEZk6kpe5KM1FuweOTLzoiMNysJ3DZsdblN phdd9vzFtm0Qx2mVQzW8omL+w91UfHutOZTxrG4HksC/NQGcCgY6qgeO8aH9+oh6UH6tZibdL mPgizgk0LI/RHgcoR/xy8U7wyVzQHhrqNl+dKpJXKJnUpXzX6pNIBFWyOBf7pnzLzqD1F1Sqt 3C23J5r99Ls6E5ZwDh5VLQxVTVNrNcTb2Xm+tPf3ZcD6iDAFwAOE7njDmIWpnndRUtiYL6tZM 7vxqbb/H5ky3+5s6yv5fKOe9SnIRMNkR6ZVg/LCwAkd1DJNokAWKVkEpXgBjgNqAzbbmKhr13 MKjAb5B/QbaSnJTtgpV+7Cq/3G+1hiyelOo1wymV65pXRqzNcr6CuU9BKlcyZF+9SMumV0ONl 4hMtx2mnnLkMYzIDrjP5Ni74LSoEKTfq79Pl14rCleAcPcgbcS15b5uGobssaEo0MSBp7Luxg /T2qmhuWbfP3sfp1QpuEb2nSjMjacKv/VXNnABsZPwF1eDSxIlVItJGLDtNkyHu4wUAOsaEin jOjln5Na14OZMrJT4XfJg//pLQBjq8s3XdISmD5/uKTpoJ52ltcKCBW/Q94EnDMt7gZ0uDDPP zDbN+UkutRCPko= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sean Whitton writes: > Hello Michael, Hi Sean, >> Thinking more about, perhaps we could solve it a little bit >> differently. Eshell knows how to invoke external commands explicitly, by >> prefixing the command with a star like '*ls'. What if we do it the same >> with pipes? That means, '*|' would mean to call an external pipe. So my >> command above would be 'cat .emacs *| grep a'. And an external pipe >> shall convert all other commands in that line into external commands as >> well, like '*cat .emacs *| *grep a'. >> >> By this you wouldn't need your restore-unexpanded-input patch any more, yes? > > This is an intriguing suggestion. It would need to be implemented in > `eshell-parse-pipeline, rather than `eshell-expand-input-functions', > because parsing is required to determine which *| are unquoted, etc. We > also require *> and *< redirections, also in `eshell-parse-pipeline'. > > So, I guess when A *| B is parsed, it would be rewritten to a single > call to `shell-file-name' in the way that `eshell-shell-command' does. > I am not sure how feasible it will be to implement that within the > existing structure of `eshell-parse-pipeline', but I can give it a try. Perhaps. I'm not so familar with the eshell code, so I cannot give you much recommendation on implementation details. > I have one unresolved design question. A disadvantage of your proposal > compared to mine is that it is much more laborious to convert an > existing pipeline to use the external shell: you have to replace each | > with *| and > with *>, etc., instead of just putting || at the > beginning. Yep, but this isn't relevant for the user. This replacement shall happen by eshell itself, in the background. And it isn't necessary to show this replacement by the commands in the history. > I think it's important that it is easy to switch this feature on and > off, because it is often only after you start figuring out a pipeline > that you realise you ought to bypass Eshell's pipelining. As I said: switching on this feature just needs the asterisk to *|. > One option would be to add an entry to `eshell-expand-input-functions' > which converts all | to *| and > to *> when the input begins with ||. > But that is too simple, because you need to parse the input to know > which | to replace ... any ideas? I don't think it can be done inside > `eshell-parse-command'. Again, I don't see the need for the heading ||. When there is a *| in the command line, DTRT. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 13:13:41 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 18:13:41 +0000 Received: from localhost ([127.0.0.1]:44225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uVA-0003nE-Pb for submit@debbugs.gnu.org; Mon, 27 Dec 2021 13:13:41 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:56385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uV6-0003mq-Kd for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 13:13:40 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id B2E513200F3B; Mon, 27 Dec 2021 13:13:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 27 Dec 2021 13:13:30 -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=WvyKcDVyne7mz4NgzeRPMEJfkp IDy2W3vgGl6Dfa3Fg=; b=F0Q14VUv5ySsTGVE+fI11MKGl4bEsP5oWQvNEhwn7d iuP08trE0kVKrK85/Xmd6eifTPnxRlnA8HrW6xYss/jN/0qmZUqfjvxBxUioWWfW HsvSimexTt/AEpmlCEwsiJOAoa2fW0lR1VBir9ZvMkMAJb6jsxzF6AuO4OH3/MKT mf/p0CDFCOBAGZyKRx2RgVAfh3hecQ2wVTiUgHHeaOvZNZiC///BtiSYQCac+4DV pI8pzFOfIbMGYMYnNELMQCPOXC2KvMvKhhjdqKRqRnIcTGA1nci43qJDTcp9e6cl 77EgtLJVQpUpOjP1SOXGi/X2SS0a/rScOW/rRnGQP3qw== 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=WvyKcD Vyne7mz4NgzeRPMEJfkpIDy2W3vgGl6Dfa3Fg=; b=TaoMcmK/BgTJUkzbF6vXCL 0+Cs7EW3mjzTaIdMwWPtFi4h6pZKX7v7IfV4oZCQG470XvUF5N/dotWcFOYT+gvX SRH6p+5b5PJC0LxZKmSD5VvA9kDBTdaXVZcROCm9JkWRDux+c1N/iSc/QZJC3/FR gLtv0owdf2q654ghJzgRoYeU30KvYeXTvK5o/VM73CgazmU0/lkrHPSkiEWzVZfl gh+xc4upVE4DwI19ba4UdyWJa2XcItdcE2xyFhgTDBNmeEmrFir/j1IQ+JpzluFR JQeh98w5xVtxsaPko7spLGkx1aSLoNyf4t9q3UwYkWTkGhJHG87fCv6tSOd6wmaA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddujedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Dec 2021 13:13:29 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 078B77E9113; Mon, 27 Dec 2021 11:13:29 -0700 (MST) From: Sean Whitton To: Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <871r1yaz36.fsf@gmx.de> 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> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 27 Dec 2021 11:13:29 -0700 Message-ID: <87y245zzjq.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Michael, On Mon 27 Dec 2021 at 03:42PM +01, Michael Albinus wrote: >> I have one unresolved design question. A disadvantage of your proposal >> compared to mine is that it is much more laborious to convert an >> existing pipeline to use the external shell: you have to replace each | >> with *| and > with *>, etc., instead of just putting || at the >> beginning. > > Yep, but this isn't relevant for the user. This replacement shall happen > by eshell itself, in the background. And it isn't necessary to show this > replacement by the commands in the history. > >> I think it's important that it is easy to switch this feature on and >> off, because it is often only after you start figuring out a pipeline >> that you realise you ought to bypass Eshell's pipelining. > > As I said: switching on this feature just needs the asterisk to *|. > >> One option would be to add an entry to `eshell-expand-input-functions' >> which converts all | to *| and > to *> when the input begins with ||. >> But that is too simple, because you need to parse the input to know >> which | to replace ... any ideas? I don't think it can be done inside >> `eshell-parse-command'. > > Again, I don't see the need for the heading ||. When there is a *| in > the command line, DTRT. What I had in mind was a pipeline involving more than two commands, e.g. foo | bar | baz >quux Indeed, this is exactly the sort of pipeline you might want this feature for. But the user would have to manually insert three asterisks to turn on this feature. That seems pretty inconvenient -- any thoughts on how to improve it? -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 13:22:40 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 18:22:40 +0000 Received: from localhost ([127.0.0.1]:44254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uds-00047F-9Z for submit@debbugs.gnu.org; Mon, 27 Dec 2021 13:22:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1udr-00046x-G8 for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 13:22:39 -0500 Received: from [2001:470:142:3::e] (port=35708 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1udm-0004EB-2M; Mon, 27 Dec 2021 13:22:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=I8jRG8qqiXGHYSwGSuKZGvLE7ZcFceHM4brKS1L6AGA=; b=SIfv0ScOMR19 g478UXaLkS5RQYc7mIKl0zZ8jwLVU2Fynx8ObajGjwFDwEy0NRS3p8hPq8wutJnW/+mqmVNfjqpJo pbn/OTpCsaiH8qQKEFkZ9Jc2KCNYyV7zStZ3kK1D2+fh+fTe+Gqgb3b/pHhkE79hbj/qAgOnI8VvO 8CXT5OFqBqddVmIV7+XW0jyP85kmUaUU4U6Ciy4RGES66sPQCUUROk0okbyZq+hOQh7E5kIi4GCoi ex4p5CXZrYR51VE8ahtA1Lll7wGFRqvr6yQXMV0WmmG8l+SvfHJBjOLHCo3v/v2tNhMtK3Tdg/oe+ mpf1MC98ESEEcU5TIBoQJg==; Received: from [87.69.77.57] (port=3606 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 1n1udm-0003tV-5O; Mon, 27 Dec 2021 13:22:34 -0500 Date: Mon, 27 Dec 2021 20:22:31 +0200 Message-Id: <83fsqdnc0o.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87y245zzjq.fsf@melete.silentflame.com> (message from Sean Whitton on Mon, 27 Dec 2021 11:13:29 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Mon, 27 Dec 2021 11:13:29 -0700 > Cc: 46351@debbugs.gnu.org > > What I had in mind was a pipeline involving more than two commands, e.g. > > foo | bar | baz >quux > > Indeed, this is exactly the sort of pipeline you might want this feature > for. But the user would have to manually insert three asterisks to turn > on this feature. That seems pretty inconvenient -- any thoughts on how > to improve it? The easiest way is to add a user option that would make every pipe use the external shell. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 13:26:30 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 18:26:30 +0000 Received: from localhost ([127.0.0.1]:44258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uhZ-0004Eu-QU for submit@debbugs.gnu.org; Mon, 27 Dec 2021 13:26:29 -0500 Received: from mout.gmx.net ([212.227.17.21]:35033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uhX-0004Eb-4m for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 13:26:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640629578; bh=9sdFYGTKWnOi2zYfeyorvNl63LAdwOH0XLWa5iImdOY=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=HcIlA3BKeES6vUZ7cs7hCLRptajKWxAmvHKSS6KHV+70lse5U4ebAaTlwL8zqPP45 7k9nNlH6guaA/r/wnHKZOIHzue5eZlcTxEyxFe8EPikWhww/TPqlI2AWe1doECulPU zlTrysyn8PGAYjH9RFVDO7X/NZrapmEmF0MxhNWI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.124.170]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M72oB-1n4xde3zgN-008YxB; Mon, 27 Dec 2021 19:26:18 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> Date: Mon, 27 Dec 2021 19:26:17 +0100 In-Reply-To: <87y245zzjq.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 27 Dec 2021 11:13:29 -0700") Message-ID: <87r19xaoqe.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:bsDPWJq8mW4y0a0V/8ErrqBajiLqyOrR/HA5TdqBcqPe+uw7VNe 2jL1Uk2ao/YQIxENtP4+hFHTE9PwQxoJXGUxn5Z/Ja58kfPTqefGfgpedNysQmlsAKafwh1 T7m1asRMZaeXrNXkK2V9nnKYT9mXVGeU/rQp7x/WoJfvJKdUnVuybtiFpHA4nILN4T4seEu TSu84txb7VrClbAuYZFAQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:B2xQtN+O4CI=:uj2QeMC1A1RlWOJBdFJz4Z d6fC25NkTdMTmWLbqBvEZTaET19SvHm/8qWkPnMNeQhA1Xs548H5zAneByzxjA+ApBvXBwaiU H5hLf4My9GcQBYxbHkHp8O+gZ0Ggxwlp+hn+fjVMc088ct8yjIuS5ARi1msOYmdq9LvZIAK0O B7Jb18vz6GCyyFCYlzCfigqIrEfsiUBGwp5FN3Bk0y6hlwuARhwr3OiF5cYrdHv2XrHlsdPB2 CuiIdtMY5d6POF/tZO9EL6hEkbwyl2gIBKPQqMN3BcjIrjXhg+zWWiKNa9Psgi8FuuS9YwcpT UtH3F2c49OOCRSKOym+Bn/iijromXlOkWN0WVGSCMyB7XOLbZR6D8LZQazt4ts+AxXUzExWiA PhPTyySzkmmwZtsWnEZU8VRU+XlGhdwJIEnNWk1Paw0pgg5hsPCCDFzV/UwWKGI5x2qsAS1+e l3KR2ev8LovvEz3oyAqQXHOduZ3Zu6xlEFmBG0+Fi1Kx1AUdUlz6qSUHhPRldkDtPCqqrURR/ igvPNtJZ/Ro9kxBh5jQ/vqSt1E64q96YNZ/FUEgg1dg2YiEURKeYaSXZBEfKKWwjg3GKn0lYa wPTNp8Up4/MByzQ83nXn0aiofZe88zCsF+AndljXcins57s5Inq8xlE9CM/sj75q8UrkH1NhY sGgTbaNmBkp8A+R4wetf1RwzwETV/YAORLXxzudtDD2NCPe875ys2jfMWxYnfCKIHwRUg8qEu roH9drVrdQdNk6tjLdseJq+tFrUSWjUoJfBjQK99oBu/ot0/q8C3fxk7zO8Vx1N+/f/PxtlXY eXRzNYbqxhxUoWxRonn+ViXw5l2zkDixWIRpZA4aZUV4RiOdHMNNYOlEBb2es9n8OFxbR+T+6 LEMdedrUvuAO9kZDuNeggWBfc8oeQ/ZyxxhuBa/eQZJWZIct3w8o9d+WDxF10F6LMmOKjcWwR pw/WhpmWiQPOq81b7xncPyp1hQN4OHLySXAv7JdBpXJKxwQEq1isjmbQYnyy15wYl3Jp0zKGq x93iWn6DOLTfHgl8PtLHfl4TZ4O/cLs0BmtqpSEDpC6NG8VMFrXi+DReXw66Gf2mcMPf2nQJ2 YNPTrMPWCNbc8c= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sean Whitton writes: > Hello Michael, Hi Sean, >> Again, I don't see the need for the heading ||. When there is a *| in >> the command line, DTRT. > > What I had in mind was a pipeline involving more than two commands, e.g. > > foo | bar | baz >quux > > Indeed, this is exactly the sort of pipeline you might want this feature > for. But the user would have to manually insert three asterisks to turn > on this feature. That seems pretty inconvenient -- any thoughts on how > to improve it? One to rule them all. As soon there is one *|, *< or *> in the command line, everything is regarded external. Also commands like ls or cat, which behave then like *ls or *cat. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 14:22:02 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 19:22:02 +0000 Received: from localhost ([127.0.0.1]:44293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1vZK-0005zZ-8j for submit@debbugs.gnu.org; Mon, 27 Dec 2021 14:22:02 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:53413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1vZI-0005zG-NT for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 14:22:01 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id CC4663200D18; Mon, 27 Dec 2021 14:21:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 27 Dec 2021 14:21:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:references:date :message-id:mime-version:content-type; s=fm2; bh=6c/IJvvlFoHBh2e gKqDc85tj30sljmfSY+wqTzsxD1s=; b=vEaytHqPxext7eA6Bqf3J/TgPui0AQm mXTZCj1z1tyA2hpQkyENVcjZw0/23dHgCebhj+6d5fGk2yZ7+SpSxGmnGHKl45eZ frYu6JcYo7ayjx4UigSoG2YF1lr8WOQp0vKpS9WUc3flUF/iZX/8TmmZTNhnBpWp n53/STwgveaFC7UjvKMl7XOtxCxBZrrAvnFN2vSlDN0ONCuqwBfeBiTfPe1/h+QZ 0MxzijPzSRjYYRGBz1Bd2y7Clf4snqp8+DdKgmv1nf6CjSYGzIsEhSQH66kYf8TN pRUYh8nyhPf4SdNCDaZ9TkmMEST5AGtMxspdqsFTEHS/kOS5cAhLaIA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=6c/IJvvlFoHBh2egKqDc85tj30sljmfSY+wqTzsxD1s=; b=aPK/u/SZ mM4rbAYYkzKM9CJ5XCHia9HCShIIt7s4VgjfMrQvkwm62ay36qLivLIes3wygBj+ C6ea//g5qb1g6S4U3WZSrRyMKt4am28pr+IFvfVZEx4KN7ntFOCOjrkCIJGkBMib yTQQCGkXv+J4Ek37r8ZUHCNUW0gLjbCZTL5UWSs/X4VlWOAN5c7Xb4n9X3/FGCXx iwi4d20tQdDQxt9xWuKGRPFytRgOEdWvhuCE5HnFDmtABceBTVywl1CluFIxmca5 c0NcqVPWU9cX2CyYiSMwOOXxrUXXSY65QSBIENP+RbhL6VUrnY2mMyDM2FIhDp+F icFWS7a+lkkdZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddujedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogfthfevqddqjfgurhdqufhushhpvggtthdqlhhoficuldehmdenogfthfevqddqjfgu rhdqufhushhpvggtthculddvtddmnecujfgurhephffvufgjfhhffgffkfggtgesthdttd dttdertdenucfhrhhomhepufgvrghnucghhhhithhtohhnuceoshhpfihhihhtthhonhes shhpfihhihhtthhonhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefhteevvdelieevgf dttddtleeghfetjeefiedugfeihedtkedtkeefkeeguefgieenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsphifhhhithhtohhnsehsphifhh hithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Dec 2021 14:21:53 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 20F257F7F72; Mon, 27 Dec 2021 12:21:53 -0700 (MST) From: Sean Whitton To: Michael Albinus , Eli Zaretskii , 46351@debbugs.gnu.org Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83fsqdnc0o.fsf@gnu.org> 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> References: <87r19xaoqe.fsf@gmx.de> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 27 Dec 2021 12:21:53 -0700 Message-ID: <87o851zwdq.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Mon 27 Dec 2021 at 08:22PM +02, Eli Zaretskii wrote: > The easiest way is to add a user option that would make every pipe use > the external shell. On Mon 27 Dec 2021 at 07:26PM +01, Michael Albinus wrote: > One to rule them all. As soon there is one *|, *< or *> in the command > line, everything is regarded external. Also commands like ls or cat, > which behave then like *ls or *cat. I see what you mean now, but I don't think either of these options would be desirable. It would mean that you can't combine Lisp functions with external commands; for example my-lisp-function arg1 arg2 | my-cool-encoder *>output.ogg In this case, the first | needs to use Eshell's own pipelining support. Similarly something like buffer-string # | my-cool-command *| other-cmd *>file Does that make sense? Would you agree that this new feature needs to work only on individual pairs of commands? -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 14:35:53 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 19:35:53 +0000 Received: from localhost ([127.0.0.1]:44304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1vmi-0006Nf-Rx for submit@debbugs.gnu.org; Mon, 27 Dec 2021 14:35:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1vme-0006NQ-Po for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 14:35:51 -0500 Received: from [2001:470:142:3::e] (port=39166 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1vmZ-0005ha-Gl; Mon, 27 Dec 2021 14:35:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zBFpQ7dmvmD132zfv6c9wZ9dqL0SdGI458xFRsGvN8w=; b=PQv1daogLi7A MJCLgluYCUgTEthsrT4gW+yDVx8yOUvJasyFkilThlFi3oqGeHI+fhH2YdB/rCaOdg1aYTmysVHzj xandy7S0JTk3ahpWsMcKJb7qknV7sO5zzWi8nV6WnnjwoUhcd4y24aUHGW7OZ1+oE3TOrWrtPXjj6 YwTbm26godQqLsbjsQD2IdKkyx1bRTi+auMD72huYxPEexkavItxO+uNj30C1Zq06g84Py0W7k4rL mu8wCfmWiHt3R7tkPJxiMN43FlaXX1Q+mcunxq33J9LcZ3SEETQNhudplbmVQgo//4BDnkJu1QYr2 bG289oBSQddJU+IwYCZYFw==; Received: from [87.69.77.57] (port=4190 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 1n1vmZ-0005Wi-Ec; Mon, 27 Dec 2021 14:35:43 -0500 Date: Mon, 27 Dec 2021 21:35:40 +0200 Message-Id: <83bl11n8mr.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87o851zwdq.fsf@melete.silentflame.com> (message from Sean Whitton on Mon, 27 Dec 2021 12:21:53 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <87r19xaoqe.fsf@gmx.de> <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> <87o851zwdq.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Mon, 27 Dec 2021 12:21:53 -0700 > > On Mon 27 Dec 2021 at 08:22PM +02, Eli Zaretskii wrote: > > > The easiest way is to add a user option that would make every pipe use > > the external shell. > > On Mon 27 Dec 2021 at 07:26PM +01, Michael Albinus wrote: > > > One to rule them all. As soon there is one *|, *< or *> in the command > > line, everything is regarded external. Also commands like ls or cat, > > which behave then like *ls or *cat. > > I see what you mean now, but I don't think either of these options would > be desirable. It would mean that you can't combine Lisp functions with > external commands; for example > > my-lisp-function arg1 arg2 | my-cool-encoder *>output.ogg > > In this case, the first | needs to use Eshell's own pipelining support. > > Similarly something like > > buffer-string # | my-cool-command *| other-cmd *>file > > Does that make sense? Would you agree that this new feature needs to > work only on individual pairs of commands? The *| thingy could be available as well, for when you need a mix. My proposal was only for the situation when it's hard or inconvenient to change too many pipes manually. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 14:37:20 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 19:37:20 +0000 Received: from localhost ([127.0.0.1]:44308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1vo8-0006QW-76 for submit@debbugs.gnu.org; Mon, 27 Dec 2021 14:37:20 -0500 Received: from mout.gmx.net ([212.227.17.22]:42487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1vo6-0006QD-Gs for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 14:37:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640633829; bh=9w/hFFPYpRhFk4EHiJwTeypNQap1gT2KP7tEeo02yNg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=NXZ/CX2zEtP6iTCBbYWX9g/KddMrJ8q3Eve+iOZMbdgtTNIPsWE2c9rWcw1NLcRc3 Ho6MDhuE/H1KsRTsG1oc7seYpYrixleMadDbhemEzmJPByvMEmxWQ32p8TR41Hs01R GVgooqFf0wFDFWTCNcwpYurd5ozBhv3qxeT7UTkY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.124.170]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MGz1f-1nEsEQ134t-00E8fN; Mon, 27 Dec 2021 20:37:09 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> Date: Mon, 27 Dec 2021 20:37:07 +0100 In-Reply-To: <87o851zwdq.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 27 Dec 2021 12:21:53 -0700") Message-ID: <87lf05algc.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:MN1HVFl+n/5lZxz36/0mT7/hSvMteEN+tUT56/IAilgGVLCrOGI mJbk1AMnadObdtuVPeB7C8o3w2qL0etuEt9lDqWRyUJWk7fJLcCEEZrUzyV+fb1YA6PEl5a rdZ7qvkMR32wnILw8HkRs553xQjnctN8GLM/1sjDjiW0WEWhqGK428LRVWhC7Mwm0r69n/H KjuqVvyOyPUYhs5kvZ3dw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:AfkZHUFt37I=:umm340C3KrcyX2kM8vwAPv iOv/97J1rTHgxbi0794AZ9bq7JfNxlmboetYF7Wv4dYtyZU2GuLSIMi3BbVlVFsu4LAGWDY+S 9x+7BVjvJ1rMUaiMBoloQjf+m/mnSEzHXCW0JQnlvzM+6gSexZ8hsJthWYesH6iv2LbsMsp/e r3sAs5WiJ6U7wp1enJbYcCc26HX+co63Y8cJrJw3e05qWwT5zlIfeuq9ZZv6b/DXYIM+9Tm0W ka4fuMUuxQ8awoco84JO9HmdzWabpgKfxNnlCOYfsmgVNnPKjJZoqF/3irS8c1B4RRoxyShwS 2Kvyt1G/OZHqG2Ar570+Mi12CEEHV57VTetfHz85quR4cddmEOpJdZ55aI2iFtfuUGvNVPBoE sof3NIzSQhZq+35Ym5v1pgjniLTyMi9NuNfKVYy15r0VTyw42UxZvXWSeel/z5T+H7b8W0V21 8Y8qbBD2TG2mPdRgvvzRZ+gL+OFnJ/6B81GXMZGccSGnqjx7duHInvASQHOXgqCCFu3Jggvl7 WUp/Sy0tk+5yCmHsppAg7TM3FNDGtrXyGgP0J0b8jyfWVgkSrWYc+DVGGRRf2YNmO3wECI/An Tbqq/jNke8evbE4YiHEFCb3WUlzOXUv6iyTyQw426awlWA1G22U0yyg4HP0mid4ugsciwNRrT saqCib1PM+KikLyF+RBWowqz6qVbGbOtmn0z2yMFkaW59bps8BPPxurCMUYoR9F5YFv4DtI2x mq4H32JyJzX1COUds5j4UQ6jZhvGTCas+/6dWcWE75auHa7uxTgBHI0DDR5lwH5hGH+kuP3gb 2K6PqWjaIIII5OUboR6M3EUbW1p35V7g2gX4aWckHX5mQ1AOugmRlNh3pPd7vd1nMpXCtaAfB KRQfIgT0siVlv2iPd2BhVKx3DGkyZFGd4vUjIJI5jxWNybGhUpFFwYj3BDoL5cGNI0EYI+jeY VsVhdWDb4VK6fR+JdOdLeIhSSENcivzCbqfrvp7VAtfG7YQMgIbrn+605vBQrQpBE9x+jD6LI HmSrWvK2OTgrG2h32C8Yu+JqmfCHJ9k2WhAmQqD8z6rPcm/18anHhbL77S2ZNNqIqApFeyQlC x+IgpiRTVg5RWc= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sean Whitton writes: > Hello, Hi Sean, >> One to rule them all. As soon there is one *|, *< or *> in the command >> line, everything is regarded external. Also commands like ls or cat, >> which behave then like *ls or *cat. > > I see what you mean now, but I don't think either of these options would > be desirable. It would mean that you can't combine Lisp functions with > external commands; for example > > my-lisp-function arg1 arg2 | my-cool-encoder *>output.ogg > > In this case, the first | needs to use Eshell's own pipelining support. > > Similarly something like > > buffer-string # | my-cool-command *| other-cmd *>file > > Does that make sense? Would you agree that this new feature needs to > work only on individual pairs of commands? If you want this complexity (external and internal pipelins and stdin/stout redirection) in one command line, you must mark every single such operator with an asterisk, which might be inconvenient. But you have the eshell history, which gives you the command line including the external asterisks, which let you edit the command prior reexecution. Personally, I could live with both approaches. Your proposal with a leading "||" is similar to my "one rules them all", because it changes the meaning of all pipelines etc in a command line to be external. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 14:53:59 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 19:53:59 +0000 Received: from localhost ([127.0.0.1]:44338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1w4F-0006x7-89 for submit@debbugs.gnu.org; Mon, 27 Dec 2021 14:53:59 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:35551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1w4B-0006wp-Qh for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 14:53:57 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 45ACC3200EE0; Mon, 27 Dec 2021 14:53:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 27 Dec 2021 14:53:49 -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=iV1TddUhUGawjioVrtFN8IyAyX tC2iKKkW2aRsG+YRg=; b=fBsg1oPJa6Y90M54vNkPkoFaz5yMYBKSt1wI4uNyVp KOYvtDVZ+iz85M4F9FQjQkOqgvW74xFEtbz88f6QQr505ma6H/+2yv0Gs9SYg4dl oCJrHWSauGUi0ba5pV1F5EOeR3L3jGQi0GjIS79Ct5GhJ+gynVzxP/SqRbYY3buV ICeaxC0+xG0GjlaMn1160iKlgFgdZJqQr2VRQKO7Z/lLh7ur9pJZRr4pGSzmTpwF L7bkv/3r5Y2FY2hUMOJt+0iR6ow41f3pzMyFKPyezO2Z9eyytzkaqnEEcIvtfFfe nC1k50I/wmB5+5WPEFLjTyB5p/sckOV3unxRpxh5AE+Q== 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=iV1Tdd UhUGawjioVrtFN8IyAyXtC2iKKkW2aRsG+YRg=; b=QhOY3uaG2TEp9+z2V8LEdc YDyKaJfQMh+duAXAC/rVasVyBt0742gwcAZg090aSpCtYQeJ4aFEqcA1GfYNLznF pbjF8ciOVMraBdLunxScRpugUIWso2umESg9kgD+Ha6QJpxyilc45zhS2pWW6KeB KMkaApre+oVWw4C8KjR3gHocNbrdKDktXJ9Ptle0wijPkpBeH1u0hpy/ZxWSGQn+ 6wyEaMyEUHhBxTyXgmnkllSyBSXqvcP21QEMm4UbDe8Vn5jKxAQ6kZBW029m3ZD4 6P5LPPHzked8f6+FJg3PlcDOgr+4MyvHEBdjDhoPECSupqFBujm6aNj0FF5frHdA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddujedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedu geegfeetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Dec 2021 14:53:48 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 0FC8B7F7FA7; Mon, 27 Dec 2021 12:53:47 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83bl11n8mr.fsf@gnu.org> References: <87r19xaoqe.fsf@gmx.de> <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> <87o851zwdq.fsf@melete.silentflame.com> <83bl11n8mr.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 27 Dec 2021 12:53:47 -0700 Message-ID: <87lf05zuwk.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Mon 27 Dec 2021 at 09:35PM +02, Eli Zaretskii wrote: > The *| thingy could be available as well, for when you need a mix. My > proposal was only for the situation when it's hard or inconvenient to > change too many pipes manually. Ah right, I see -- yes, nice idea. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 27 14:54:47 2021 Received: (at 46351) by debbugs.gnu.org; 27 Dec 2021 19:54:47 +0000 Received: from localhost ([127.0.0.1]:44345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1w51-0006yv-Kf for submit@debbugs.gnu.org; Mon, 27 Dec 2021 14:54:47 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:48281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1w50-0006yi-Pu for 46351@debbugs.gnu.org; Mon, 27 Dec 2021 14:54:47 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id F1F633200E91; Mon, 27 Dec 2021 14:54:40 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 27 Dec 2021 14:54:41 -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=XM+Bip4JWyD98CM6SU1XZ87xdV Wkv1eGdX4vTGjKyzM=; b=zXUpnKSt5geQAkBWp8N5iSLWr0WPf+62LISjomWIwa f1ta2ELhmXcezn65oXfRN7btQlUwp0b4aMVNf5QKTKuEpgu2UEQL8Vw9qURPEfPy bUVrYiwwV1YwyIvB+woD99thHV/0viCeRSeTDm2/0YNyGhgb/ISF/C0LDrbq2CrX NMTxb6L5TRgDPZnZXwh9nCljU6njAWPU6N5gvGeH+BJ3/Qaw8s374cLAmQ1HZFbN g1MRNJxghHmh7CklYGeGcCuLIaapfkUWrTVqFuh5DoE1ZN6tZC9+J21+USymB1uX JIU5pCCgVsFGdJ8S6g/+V9pnyfxlCmzATq10YoWORIdg== 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=XM+Bip 4JWyD98CM6SU1XZ87xdVWkv1eGdX4vTGjKyzM=; b=XQ0DKxhyQbNzLhvwyC4kCk ksXirFQ15qK8ZqdQ54DBzMrtNWEhfiQfrz0qnfxaJ3ghbvP3Qmaa87QWpa7/LSqM DWTfY/HIe5KQ4GLL/rU19u1wb9AIq7BEUP1s1Qg7Y5rt+XzSFC5dgPKf9HZ8ftnw 8/RARobOd7Rfy6F9wSlvosvgQ98ry3cuPT++Zh0BoTPvHdKUKS1W1AgMgLY8YAwA tjgCOhTY2B451COctcYbnYfk9EUXsO37XQsl7ZaSHuGjtK2VxfSzCG/yRIQ/HDki 0G0VVxp5gVjQNVxYOswiUzq73HZFDO5siGeoi+nHHLt03dDwkuzHt/9ePW+6Ateg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddujedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedu geegfeetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Dec 2021 14:54:40 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 34FCF7F7FA7; Mon, 27 Dec 2021 12:54:39 -0700 (MST) From: Sean Whitton To: Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87lf05algc.fsf@gmx.de> 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> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 27 Dec 2021 12:54:39 -0700 Message-ID: <87ilv9zuv4.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Michael, On Mon 27 Dec 2021 at 08:37PM +01, Michael Albinus wrote: > If you want this complexity (external and internal pipelins and > stdin/stout redirection) in one command line, you must mark every single > such operator with an asterisk, which might be inconvenient. But you > have the eshell history, which gives you the command line including the > external asterisks, which let you edit the command prior reexecution. > > Personally, I could live with both approaches. Your proposal with a > leading "||" is similar to my "one rules them all", because it changes > the meaning of all pipelines etc in a command line to be external. Right. I was thinking that the piecemeal approach was one of the advantages of your idea. I'll see if I can implement this more complex thing and get back to you. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 03:58:52 2021 Received: (at 46351) by debbugs.gnu.org; 28 Dec 2021 08:58:52 +0000 Received: from localhost ([127.0.0.1]:45025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n28Jo-0001sd-B8 for submit@debbugs.gnu.org; Tue, 28 Dec 2021 03:58:52 -0500 Received: from mout.gmx.net ([212.227.17.20]:45129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n28Jl-0001sN-Ha for 46351@debbugs.gnu.org; Tue, 28 Dec 2021 03:58:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640681920; bh=fNP4mqnNYom7RU47GN2ZQbT6TurPTYTRJsAbs20emng=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=j5E9Btg+JaWHwBbryyMGL7y422NteZepiBAL+YnlKT541CiLIaCC3R8aj7m9V21Uz +SAFsvr2QZELFMrPQNCqKA/qnz1izpEpYyGwebyyIKiM+ZGGlpDtb1F6kfUhGvJAKd c1atEnZeEstJa/NPzVX8mjTIbrLd0xo/Ay3H4yok= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.124.170]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MatRT-1mQKea3rml-00cQ1v; Tue, 28 Dec 2021 09:58:40 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> Date: Tue, 28 Dec 2021 09:58:38 +0100 In-Reply-To: <87ilv9zuv4.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 27 Dec 2021 12:54:39 -0700") Message-ID: <87fsqd9kch.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:tf5oTqUtAKQGUV6U85CXc525usutLb9KNseYldtSUw1CSYpJWm2 eRk1txEzuJCKSBlZVFrcg7NMgRONsh3Aq97xJb7cqnB8k+GWTtvXWuSnzXmpy8vCt46Y3kw wdYaU0HUD3gSG1Acn/reiWIsVF+4XojFn6agP/F8a57KAi81cUxQSKGgK7Lfs9PF1IuNJUp TrpaLgd0JFpRrTsVfeyxg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:4X1R8rNc+fE=:4uJA41EiNzm9CJJsaZ4msz T93sioVqNRYSVT9C5USP3uifE4AUfTpzlgyL+Sj+wlulfdnVsgymoxciZOGCX7nbUMBXVPJ1p fzKsrF6g3/vIpZOM+lSxNCbKThui9V5WokeiTLjBMRNqN6NpHSbZlTRO9o5JQUr4g7iddvYq9 pYgcG7qf4fqtRjPmSVGl7WLZwgWQW10Y0BYJH/PFWo6Np3cWcRDhwww2LDcKPPCOG8hZ+p0O4 tNn5AJltCAKe9nkoGWnSB7gxRB1XfAd7XaVdFbKvml9QzFD74oxNv86Vr1Gscj7hpVrsJnm+U MIPsiEkItlLrMSE03YnvuMIElwI88bsdu8LVfkwEK/k5d7Chbwafgj+ANLokGROYcYnQ14MCN f6zvDUed7/jX38Md8se1MbdpytLjeCj57CGMpnHaVORjh2uhZVbqrK/rsm0mez+N7cCAz9S0G E35dYFeV1zmZZZpiegnHI+zLIC4FNVciieki86A97gHVenCdnvMLX+VeCa4IogHQVcZkGkBPj +GNlx7SXUOHsqPWoXnk+N4CC2FwIcEiww5cTh5z4gc3zzIHT6f0PyoQm2JLRVvdWpSTXbYEmI oHWhEASE0puftZm0+zD4cTjNjnokVMYU3XFqXMHopaUE2v3S7e9fYgxGPwsjmhOD/VvxheIHH 6jZV3EVqzDFueKc1IfEiunV0XMGz4D7P0LwqWaozB4UebeJaXSzbkLpQ0JkmzofjdvcvOKxdi ayqop/C+7GuEknHiNXQQr2IBx1cQdqgVYv6QEy+CefynS8yTS1FpAwk4QkENc1qJLCNhD+vsy DYtsF7RIYq22lEdQePFlEQ40pUjegVeLP9w7hQ4KpZKtbZmQ5GmoSj9YPZxuceLJ7NhmAmXXn zVR6ybvDDkcTF2FAyVCzr9c3KlfNauXV659C45FmbUjkB2jnoGeWHsy8jPP95aup5x0zqxADq 7rHrlYMjOjNM9FN1/u843DR68QyMESq/9QR8vkKRrmWCGr/u+Ocfd8KlyYllJ0IUtwal5dUpN U+SRzO0vjn/KbdWCKsaKeVKlh99xeDqMkcvTDzP5dHZvWM5PyGTcEJVeQQnfkg2yr0ZnoRbKw oo2t6Y2vl7thoU= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sean Whitton writes: > Hello Michael, Hi Sean, >> If you want this complexity (external and internal pipelins and >> stdin/stout redirection) in one command line, you must mark every single >> such operator with an asterisk, which might be inconvenient. But you >> have the eshell history, which gives you the command line including the >> external asterisks, which let you edit the command prior reexecution. >> >> Personally, I could live with both approaches. Your proposal with a >> leading "||" is similar to my "one rules them all", because it changes >> the meaning of all pipelines etc in a command line to be external. > > Right. I was thinking that the piecemeal approach was one of the > advantages of your idea. Yes, it would be. But it is more complex then. If you have an external pipe *|, a built-in command on the LHS of the pipe must be external as well. cat behaves already like this in pipelines, perhaps we shall request this for all built-in commands. > I'll see if I can implement this more complex thing and get back to you. Yes, please do. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 00:20:13 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 05:20:13 +0000 Received: from localhost ([127.0.0.1]:48593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9gui-0004F2-Fx for submit@debbugs.gnu.org; Tue, 18 Jan 2022 00:20:13 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:59773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9guf-0004EJ-2h for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 00:20:10 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 42BED3201DDC; Tue, 18 Jan 2022 00:20:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 18 Jan 2022 00:20:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=oUf4VxFAoC1+cFpCLbK9+DfzFM PizAyH0kHQ4+qcTEM=; b=sgw5HwjrQ1R8A4YvA4lMf+pYLQ4SQqsfd5j11GcWN/ vfiDgCd9FJni/vkWk6/5L05OPhAvJmGrwdVqyG+YVIPJQRIEz7cSdEnUPLGb0vK9 hGoLfmeH9OUoOQo70vlXMjstaSR/z2VGjgmDO+9P+ixIuOv5OK8VY+3RGVnNJwCt dZldsqC7GrkTuquXgYFQXGUZ1v0sZGzVmS4lrcmW4aPUkv+hPrZ+xM9MJGAMStMu 7T+k90KTgxTgj8tx+4KW4d+TnNQ+CawBiA6NHel0PyoT34zlxfFhKRpTMbRQwakC 0Mnmi3ZVcBEYncahDpLAuPpkUg+8ZI+6f8a6LeMUZEJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=oUf4Vx FAoC1+cFpCLbK9+DfzFMPizAyH0kHQ4+qcTEM=; b=SlnuyZ0rEjVHF63W6/dk3L q6HUMS9t+YruOH6wq0RuI0Ods+Y6eDxAJMzJJXwiEWwJbwm+/3Nz0iEahZ/blPfR zqpfiQ8wCr5KUZIgCdmin3qCSyUr57+T6rCwtdATxiZCtaxbLEPZp+qEOJoUjYxV YnliUJeGx0NnRxP4vP2ZQCVQTYF900SXb7oodCDerXkTNe088ntv070TdboiRVM5 XyhFt/6skYd1X60IDCysSxHivjWsiW7+tLd3UCMBB7WpT91Sx0THR7LJZ8iUpard H4rTI6zgTOeBf2nvn9K22/k/LG1VKCetklh9bbIfU4ze9Dko52xwIz2G+x0VttJA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfetvdfg hfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 00:20:00 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 337227E073B; Mon, 17 Jan 2022 22:19:59 -0700 (MST) From: Sean Whitton To: Michael Albinus , 46351@debbugs.gnu.org Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87fsqd9kch.fsf@gmx.de> 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> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 17 Jan 2022 22:19:59 -0700 Message-ID: <87y23dei2o.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Tue 28 Dec 2021 at 09:58AM +01, Michael Albinus wrote: > Sean Whitton writes: > >> I'll see if I can implement this more complex thing and get back to you. > > Yes, please do. I've got it working. Please let me know what you think of the attached. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v3-0001-Add-Eshell-syntax-to-more-easily-bypass-Eshell-s-.patch >From 09c2cb2b43e9b988b682d13da8bf486a0a354333 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 Jan 2022 15:15:36 -0700 Subject: [PATCH v3] Add Eshell syntax to more easily bypass Eshell's own pipelining * etc/NEWS: * doc/misc/eshell.texi (Input/Output): Document the new syntax. * lisp/eshell/em-extpipe.el: New module. * test/lisp/eshell/em-extpipe-tests.el: New tests. * lisp/eshell/esh-module.el (eshell-modules-list): Add `eshell-extpipe'. --- doc/misc/eshell.texi | 39 ++++++ etc/NEWS | 10 ++ lisp/eshell/em-extpipe.el | 175 +++++++++++++++++++++++++++ lisp/eshell/esh-module.el | 1 + test/lisp/eshell/em-extpipe-tests.el | 122 +++++++++++++++++++ 5 files changed, 347 insertions(+) create mode 100644 lisp/eshell/em-extpipe.el create mode 100644 test/lisp/eshell/em-extpipe-tests.el diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index f1d7c63805..d19fe6fa80 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1135,6 +1135,45 @@ Input/Output The output function is called once on each line of output until @code{nil} is passed, indicating end of output. +@section Running Shell Pipelines Natively +When constructing shell pipelines that will move a lot of data, it is +a good idea to bypass Eshell's own pipelining support and use the +operating system shell's instead. This is especially relevant when +executing commands on a remote machine using Eshell's Tramp +integration: using the remote shell's pipelining avoids copying the +data which will flow through the pipeline to local Emacs buffers and +then right back again. + +Eshell recognises a special syntax to make it easier to convert +pipelines so as to bypass Eshell's pipelining. Prefixing at least one +@code{|}, @code{<} or @code{>} with an asterisk marks a command as +intended for the operating system shell. For example, + +@example + cat *.ogg *| my-cool-decoder >file +@end example + +Executing this command will not copy all the data in the *.ogg files, +nor the decoded data, into Emacs buffers, as would normally happen. + +The command is interpreted as extending up to the next +asterisk-unprefixed @code{|} character, or the end of the input if +there is no such character. Thus, all @code{<} and @code{>} +redirections occuring before the next asterisk-unprefixed @code{|} are +implicitly prefixed with asterisks. An exception is that +Eshell-specific redirects right at the end of the command are +excluded. This allows input like this: + +@example + foo *| baz ># +@end example + +@noindent which is equivalent to input like this: + +@example + sh -c "foo | baz" ># +@end example + @node Extension modules @chapter Extension modules Eshell provides a facility for defining extension modules so that they diff --git a/etc/NEWS b/etc/NEWS index fdbfd9b1be..144844dc6a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -834,6 +834,16 @@ the Netscape web browser was released in February, 2008. This support has been obsolete since Emacs 25.1. The final version of the Galeon web browser was released in September, 2008. +** Eshell + ++++ +*** New feature to easily bypass Eshell's own pipelining. +Prefixing '|', '<' or '>' with an asterisk, i.e. '*|', '*<' or '*>', +will cause the whole command to be passed to the operating system +shell. This is particularly useful to bypass Eshell's own pipelining +support for pipelines which will move a lot of data. See "Running +Shell Pipelines Natively" in the Eshell manual. + ** Miscellaneous --- diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el new file mode 100644 index 0000000000..a877c5624e --- /dev/null +++ b/lisp/eshell/em-extpipe.el @@ -0,0 +1,175 @@ +;;; em-extpipe.el --- external shell pipelines -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; When constructing shell pipelines that will move a lot of data, it +;; is a good idea to bypass Eshell's own pipelining support and use +;; the operating system shell's instead. This module tries to make +;; that easy to do. + +;;; Code: + +(require 'cl-lib) +(require 'esh-arg) +(require 'esh-io) +(require 'esh-util) + +(eval-when-compile (require 'files-x)) + +;;; Functions: + +(defun eshell-extpipe-initialize () ;Called from `eshell-mode' via intern-soft! + "Initialize external pipelines support." + (when (boundp 'eshell-special-chars-outside-quoting) + (setq-local + eshell-special-chars-outside-quoting + (append eshell-special-chars-outside-quoting (list ?\*)))) + (add-hook 'eshell-parse-argument-hook + #'eshell-parse-external-pipeline -20 t) + (add-hook 'eshell-pre-rewrite-command-hook + #'eshell-rewrite-external-pipeline -20 t)) + +(defun eshell-parse-external-pipeline () + "Parse a pipeline intended for execution by the external shell. + +A sequence of arguments is rewritten to use the operating system +shell when it contains `*|', `*<' or `*>'. The command extends +to the next `|' character which is not preceded by an unescaped +asterisk, or the end of input, except that any Eshell-specific +output redirections occurring at the end are excluded. Any other +`<' or `>' appearing before the end of the command are treated as +though preceded by an asterisk. + +For example, + + foo # + +is equivalent to + + sh -c \"foo # + +when `shell-file-name' is `sh' and `shell-command-switch' is +`-c', but in + + foo ># *| baz + +and + + foo *| baz ># --some-argument + +the Eshell-specific redirect will be passed on to the operating +system shell, probably leading to undesired results. + +This function must appear early in `eshell-parse-argument-hook' +to ensure that operating system shell syntax is not interpreted +as though it were Eshell syntax." + ;; Our aim is to wrap the external command to protect it from the + ;; other members of `eshell-parse-argument-hook'. We must avoid + ;; misinterpreting a quoted `*|', `*<' or `*>' as indicating an + ;; external pipeline, hence the structure of the loop in `findbeg'. + (cl-flet + ((findbeg (pat &optional go (bound (point-max))) + (let* ((start (point)) + (result + (catch 'found + (while (> bound (point)) + (let* ((found + (save-excursion + (re-search-forward "['\"\\]" bound t))) + (next (or (and found (match-beginning 0)) + bound))) + (if (re-search-forward pat next t) + (throw 'found (match-beginning 0)) + (goto-char next) + (while (or (eshell-parse-backslash) + (eshell-parse-double-quote) + (eshell-parse-literal-quote))))))))) + (goto-char (if (and result go) (match-end 0) start)) + result))) + (unless (or eshell-current-argument eshell-current-quoted) + (let ((beg (point)) end + (next-marked (findbeg "\\*[|<>]")) + (next-unmarked + (or (findbeg "\\(\\=\\|[^*]\\)|") (point-max)))) + (when (and next-marked (> next-unmarked next-marked)) + ;; Skip to the final segment of the external pipeline. + (while (findbeg "\\*|" t)) + ;; Find output redirections. + (while (findbeg "[0-9]?>+&?[0-9]?\\s-*\\S-" t next-unmarked) + ;; Is the output redirection Eshell-specific? We have our + ;; own logic, rather than calling `eshell-parse-argument', + ;; to avoid specifying here all the possible cars of + ;; parsed special references -- `get-buffer-create' etc. + (forward-char -1) + (let ((this-end + (save-match-data + (cond ((looking-at "#<") + (forward-char 1) + (1+ (eshell-find-delimiter ?\< ?\>))) + ((and (looking-at "/\\S-+") + (assoc (match-string 0) + eshell-virtual-targets)) + (match-end 0)))))) + (cond ((and this-end end) + (goto-char this-end)) + (this-end + (goto-char this-end) + (setq end (match-beginning 0))) + (t + (setq end nil))))) + ;; We've moved past all Eshell-specific output redirections + ;; we could find. If there is only whitespace left, then + ;; `end' is right before redirections we should exclude; + ;; otherwise, we must include everything. + (unless (and end (skip-syntax-forward "\s" next-unmarked) + (= next-unmarked (point))) + (setq end next-unmarked)) + (let ((cmd (string-trim + (buffer-substring-no-properties beg end)))) + (goto-char end) + ;; We must now drop the asterisks, unless quoted/escaped. + (with-temp-buffer + (insert cmd) + (goto-char (point-min)) + (cl-loop for next = (findbeg "\\*[|<>]" t) while next + do (forward-char -2) (delete-char 1)) + (eshell-finish-arg + `(eshell-external-pipeline ,(buffer-string)))))))))) + +(defun eshell-rewrite-external-pipeline (terms) + "Rewrite an external pipeline in TERMS as parsed by +`eshell-parse-external-pipeline', which see." + (while terms + (when (and (listp (car terms)) + (eq (caar terms) 'eshell-external-pipeline)) + (with-connection-local-variables + (setcdr terms (cl-list* + shell-command-switch (cadar terms) (cdr terms))) + (setcar terms shell-file-name))) + (setq terms (cdr terms)))) + +(defsubst eshell-external-pipeline (&rest _args) + "Stub to generate an error if a pipeline is not rewritten." + (error "Unhandled external pipeline in input text")) + +(provide 'em-extpipe) +;;; esh-extpipe.el ends here diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index ade151d7cd..14e91912d1 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -54,6 +54,7 @@ eshell-modules-list eshell-basic eshell-cmpl eshell-dirs + eshell-extpipe eshell-glob eshell-hist eshell-ls diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el new file mode 100644 index 0000000000..01074c95c8 --- /dev/null +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -0,0 +1,122 @@ +;;; em-extpipe-tests.el --- em-extpipe test suite -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + + +;;; Code: + +(require 'cl-lib) +(require 'ert) +(require 'em-extpipe) +(load (expand-file-name "eshell-tests" + (file-name-directory (or load-file-name + default-directory)))) + +(declare-function with-temp-eshell "eshell-tests") + +(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"))) + + (deftest em-extpipe-test-2 + "foo | bar *>baz" + '(eshell-execute-pipeline + '((eshell-named-command "foo") + (eshell-named-command "sh" (list "-c" "bar >baz"))))) + + (deftest em-extpipe-test-3 + "foo *| bar | baz -d" + '(eshell-execute-pipeline + '((eshell-named-command "sh" (list "-c" "foo | bar")) + (eshell-named-command "baz" (list "-d"))))) + + (deftest em-extpipe-test-4 + "foo *| bar >#" + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "quux"))) + (eshell-named-command "sh" + (list "-c" "foo | bar")))) + (deftest em-extpipe-test-5 + "foo *| bar ># baz" + '(eshell-named-command + "sh" + (list "-c" "foo | bar ># baz"))) + + (deftest em-extpipe-test-5 + "foo ># *| bar baz" + '(eshell-named-command + "sh" + (list "-c" "foo ># | bar baz"))) + + (deftest em-extpipe-test-7 + "foo *| bar ># >>#" + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "quux"))) + (ignore + (eshell-set-output-handle 1 'append + (get-process "other"))) + (eshell-named-command "sh" + (list "-c" "foo | bar")))) + + (deftest em-extpipe-test-8 + "foo *| bar >/dev/kill | baz" + '(eshell-execute-pipeline + '((progn + (ignore + (eshell-set-output-handle 1 'overwrite "/dev/kill")) + (eshell-named-command "sh" + (list "-c" "foo | bar"))) + (eshell-named-command "baz")))) + + (deftest em-extpipe-test-9 + "foo \\*| bar" + '(eshell-execute-pipeline + '((eshell-named-command "foo" + (list (eshell-escape-arg "*"))) + (eshell-named-command "bar")))) + + (deftest em-extpipe-test-10 + "foo \"*|\" *>bar" + '(eshell-named-command "sh" + (list "-c" "foo \"*|\" >bar"))) + + (deftest em-extpipe-test-11 + "foo '*|' bar" + '(eshell-named-command + "foo" (list (eshell-escape-arg "*|") "bar")))) + +;;; em-extpipe-tests.el ends here -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 04:49:21 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 09:49:21 +0000 Received: from localhost ([127.0.0.1]:48993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9l7B-0007SW-0F for submit@debbugs.gnu.org; Tue, 18 Jan 2022 04:49:21 -0500 Received: from mail-wm1-f43.google.com ([209.85.128.43]:43613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9l7A-0007SL-3o for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 04:49:20 -0500 Received: by mail-wm1-f43.google.com with SMTP id e9-20020a05600c4e4900b0034d23cae3f0so3664961wmq.2 for <46351@debbugs.gnu.org>; Tue, 18 Jan 2022 01:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=cJU482Oe6tCJ4aZJfrWCBI90K6I+Pz8L7wYtPhVZcVM=; b=PaiY1JCCLUYDKhqgeraw6Q7c7/A07frPE6vBREjK1ztk2dzwtBwi7nzeQ4u7FRf+X9 UhSK8iMm51cWP4YoTMqpnd5/B991+9ogsbhNCcQMt4QOQr1ZtHI7C09QYy4AxaI/VhAD l1qHAMifUUdPrG2MUQ/Oucwi8f605d6IAlCZpr7xu624qB6EvjwwGEAkYk6kpSmkA4OZ R0uSC4LURyYLGGU7gvVZVwdB780rP4SZwEqpuze7YNyy4YKkd+xY2jS5MZFRf+yiJcHV ilj+BJvGhBnhHprXZ5TfTo3N2Toa26vp3VatiUO/6c6g/JgFrn9WWQj/sxU0f11tShYE wTCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=cJU482Oe6tCJ4aZJfrWCBI90K6I+Pz8L7wYtPhVZcVM=; b=Ej/Zxsd7rnN9QHwHamGw+C+JjUGbChuP7ePzmMN00Iktqi+vJP499eYbWcxweiLCwm cGup7ok2OZMBJkafrgrAjXYxm+Ajm26mdpaVOtrQVit+P9GWNwyY4kuROvRsQCtHl26T p6eGngzsbtLV86w+1eHaff+moobiXNdJh2tc0Vp7UE7IZtJXinfTqbbGo6h5XKyS9a08 xEoPTrnOqTEc8jlKBxsjj1NqaAa/oTXU14Brj4nKFA8X/IucPBTQqmI5owU4ruO3Lomp qVSxSiSzSdZxS8YGLpaVrIhSvXllvRjRfhGypAlHg6Ox01CAyl6ZvhKifKZgF3LUY/Yv coiA== X-Gm-Message-State: AOAM53360rllqNGwv+0n9fk2+buFt1J7Z2c7/QXQQ2pRZVhiS9ztUkmQ I+d6Z18hPzrqyO+unxtG3PD/i57CGD4= X-Google-Smtp-Source: ABdhPJwdhen0yD7lBxBGtFMlikWrd+kWtOsLe/v66o8tCTxPRmhxj+TmESJLthfUz5OMZ9XZnknH+A== X-Received: by 2002:a5d:6908:: with SMTP id t8mr24089559wru.382.1642499353803; Tue, 18 Jan 2022 01:49:13 -0800 (PST) Received: from rltb ([2a01:e0a:3f3:fb50:cb88:72ae:f560:b08c]) by smtp.gmail.com with ESMTPSA id n15sm14558635wrf.79.2022.01.18.01.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 01:49:13 -0800 (PST) From: Robert Pluim To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> Date: Tue, 18 Jan 2022 10:49:12 +0100 In-Reply-To: <87y23dei2o.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 17 Jan 2022 22:19:59 -0700") Message-ID: <87wnixpe5j.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Mon, 17 Jan 2022 22:19:59 -0700, Sean Whitton said: Sean> Hello, Sean> On Tue 28 Dec 2021 at 09:58AM +01, Michael Albinus wrote: >> Sean Whitton writes: >> >>> I'll see if I can implement this more complex thing and get back to you. >> >> Yes, please do. Sean> I've got it working. Please let me know what you think of the attached. How does this deal with something like: ls foo*|awk '{print $1}' Before your changes that expands 'foo*', but now the '*' gets swallowed by the '|'. Perhaps you should require whitespace before the '*'? Robert -- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 09:46:03 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 14:46:03 +0000 Received: from localhost ([127.0.0.1]:49321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9pkI-0002pD-U2 for submit@debbugs.gnu.org; Tue, 18 Jan 2022 09:46:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9pkH-0002of-Dp for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 09:46:02 -0500 Received: from [2001:470:142:3::e] (port=37048 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9pk3-0002QY-Nb; Tue, 18 Jan 2022 09:45:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6rJoHkRbtMeEbfiRZb7G9qHaET4b85ER/ee8LaWc/JM=; b=RQOBcswD0Aty GuFrwWZ4oQvIi2/0udkv/P+fqcoM4QCYTkFJwKJXCE014nQIVz0DN3MB3eOZ4G2xj6UsLWgd5NXoV rpDAy1VSLNAP06zB/RdQl6sz8yNPwa5ZfbfLlXnoXdwGd30bkgKZGR1wrnc9rESKVW+GP3cqckWDn qkDo7c9rwPo2YI1RI0n2c8A897xn4+n6gitUsfPD5emtmK1TyzCtDyAchqzGJgfXgrFTJ0tgopWsW 7Eg70pewq2uhuLjWkvQnl3Lq8X64oduThxyDPeil4ea3k+T957Ua6AtPgii/qju7hNMn67pOB+VKZ NIgG6KJvI8ttKu4r8qyd5w==; Received: from [87.69.77.57] (port=2192 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 1n9pjX-0002xi-Jl; Tue, 18 Jan 2022 09:45:22 -0500 Date: Tue, 18 Jan 2022 16:45:07 +0200 Message-Id: <83lezdumq4.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87y23dei2o.fsf@melete.silentflame.com> (message from Sean Whitton on Mon, 17 Jan 2022 22:19:59 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Mon, 17 Jan 2022 22:19:59 -0700 > > I've got it working. Please let me know what you think of the attached. Thanks. 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. I think Robert found another possible issue. > +(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? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 13:27:55 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 18:27:55 +0000 Received: from localhost ([127.0.0.1]:51673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9tD1-00010n-87 for submit@debbugs.gnu.org; Tue, 18 Jan 2022 13:27:55 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:46581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9tCy-00010Y-Pq for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 13:27:54 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 550945C0BFD; Tue, 18 Jan 2022 13:27:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 18 Jan 2022 13:27:47 -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=HxV0C2agYtnv1d0cccshtOMDdZ v+LmN53/8g6lUlRTY=; b=xxd3do8WONJukwDG1gBNWKAVyY7VHNuGll1vzkDd0Z +3IShfib24WTTi2yhFQ5ZdqiyP6Ft0XPo6Yk/rJTXtx66IKph7xpCz6HDcDsWSgO YFgue+50zvtw12iEHkoVKeS4OevJr1K75+M5unl8IbmGD45jpndiyUFhbWC30mx/ Uv4ZEx/z1InHpmXZZkb4n5WejeDl70mrWNr9c854v3Qr2EUr2mjgz6RIuo182gni r1mx+0+JqMrg+UkPJysP2DLsXFAqk5AQ8ZiYuphjaz6hg6z4+q4b+N4CdGOwJh+y V/RuEJNRJJTnnLiQxC9cvmAvrGtVSlNYQ58PZGJwnV8w== 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=HxV0C2 agYtnv1d0cccshtOMDdZv+LmN53/8g6lUlRTY=; b=EYRg4ib9xUFMS/GQYPxT0L OZK/glBpB8Xd1zNl0LSfW6+5yIxBuSSozm7lmzf+PRlYXJ1lj86KaLiXn5rZI0Pm Pwo47o/ElHnFKgNIgdkLWE4dkRsAr6v0tXCisnhAv3gGEuetyLaiXybKM1M7gApo NU/65HSY2DMeDlluZFYda4sqoJeuKvtafipg8iQh2Yz7ujF3P7X6FjCdVQXJoqix +o/BRQlb3TnP0o+I153itjHv8APfDQ9QsK1tKkKmANhcMIEYrwL2TegpZJ+yUkrV WWJpFT8iD7XnE3H0XaEVff8QiB+501y2tomeK0Iif7/PTwa6WLJeAPK51FD8HfxQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 13:27:47 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 5F4BE7E07DB; Tue, 18 Jan 2022 11:27:46 -0700 (MST) From: Sean Whitton To: Robert Pluim Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87wnixpe5j.fsf@gmail.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> <87wnixpe5j.fsf@gmail.com> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Tue, 18 Jan 2022 11:27:46 -0700 Message-ID: <87r194ew65.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Tue 18 Jan 2022 at 10:49AM +01, Robert Pluim wrote: > How does this deal with something like: > > ls foo*|awk '{print $1}' > > Before your changes that expands 'foo*', but now the '*' gets > swallowed by the '|'. Perhaps you should require whitespace before the > '*'? Good catch. I will require whitespace in the next version. It should be hard to use this new functionality by accident. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 13:40:59 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 18:40:59 +0000 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 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 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) 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: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 13:40:51 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id E25E27E07DB; Tue, 18 Jan 2022 11:40:50 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83lezdumq4.fsf@gnu.org> 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> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Tue, 18 Jan 2022 11:40:50 -0700 Message-ID: <87o848evkd.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 13:42:35 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 18:42:35 +0000 Received: from localhost ([127.0.0.1]:51685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9tRC-0001OM-QI for submit@debbugs.gnu.org; Tue, 18 Jan 2022 13:42:34 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:47685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9tRB-0001O8-6T for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 13:42:33 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1D40C5C0061; Tue, 18 Jan 2022 13:42:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 18 Jan 2022 13:42:28 -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=JxriUerHcxIMKEVoXzjZ5ppsdD pGYRD4ctJ/5Ec9yEg=; b=WgGYavAAN4aSAZxDOqTm4M+k7R8wW7HpHIFuRiXHUu tRBcmRyVOtGQtisWp2v5nq7dQU3eT0ueWTzkpoVnLTdAhCgwIv+4ybPQ88pqPIUw hwKzRlcNylX0SnbhAFtvNRhahjOeado6177T9qD5rz7Jhewyr4fnAZqrtnc+FSt/ 09hant3Euj5ENu6EBVM4jl5xYO5AN4XHnwwxu85yniiFUJLDnwWKzKLzBtdJS84K 2XN1Azjuu9hqXh1XbTDgmlHlipbEIHXtLl1rcV0sXKEBnypQKi03+rGvSBBh6Q7u dFEhQYhlvAOk9mXKEUlIT8rtxyxiWQ2b9qT9xxqhYwtQ== 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=JxriUe rHcxIMKEVoXzjZ5ppsdDpGYRD4ctJ/5Ec9yEg=; b=PhC6QQHAu03P56Amm+/0lq AdGob5KLRVJqKq3z7lLxePvp9OupiiLXEpCnd2adFrDPvZFJVN5MdjhVOdGUwBd9 MZHEH+XwTdOnDcIKnc7pI/+VZlbqQePoWG5af6UGts2fqmoIab+vyk1V2NRDZBV+ 4x8oY8y+PfqE4FNXNCRpozxUMMAotn7XbaL44n5TXkhmjBmRfCepkUGWA6qzHXUn v+3UwSTwISLUXuobRU8JPPByHSZqRGKoA0JFyKRVtlcEKE71grq4GBW2jgz6ketf 8jIMH7mIwTgLgcBM1Yn0lFfw2wevHHM7qGYRlCgcjoURW59Zfs47F2plbEABbNiw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 13:42:27 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 47DF67E07DB; Tue, 18 Jan 2022 11:42:27 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83lezdumq4.fsf@gnu.org> 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> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Tue, 18 Jan 2022 11:42:27 -0700 Message-ID: <87k0ewevho.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. Sorry, missed something -- redirection operators before the first verb work correctly. I will add a test to ensure that remains the case. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 14:38:45 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 19:38:45 +0000 Received: from localhost ([127.0.0.1]:51766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9uJZ-0002w8-Hj for submit@debbugs.gnu.org; Tue, 18 Jan 2022 14:38:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9uJW-0002vt-FK for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 14:38:44 -0500 Received: from [2001:470:142:3::e] (port=45698 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9uJR-0001rF-4F; Tue, 18 Jan 2022 14:38:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Le74Ld3/CIoYVpxW6MjTvMxwdzOUFna9quW826F+1RA=; b=Qj0OeHVQOPwc XKWaqx5SOmbtIbBsGWxBqS0pbXwP+rL7W8lMRBF+AYKKspBpLRp149JKLH7sUkQFUQv8MLX1QUgd+ QbIbvzZHONSzneB/MUXtRRDSHYbtlxpX4+tn3/OVULsOGE96ESiUIE5UDYN6b4PNCszqnj1caiP4A p5IzmEeBXMTCkjpfhw4AK6C3Fa+X1kJ5SsdxmGVCUXsW5B/OjlMS8YbrzE4x1kREFZofYZAJcamCY V0QLvKBt3mpcUvcE/YRnuorLJQJrAF0RwE/5SV8/iI9kL4GZJbklpiRrq9/zA4ADdpwNwTkvriT32 I4yAAHxLPSUPJHRFYrNuxA==; Received: from [87.69.77.57] (port=4166 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 1n9uJN-0006dj-Er; Tue, 18 Jan 2022 14:38:37 -0500 Date: Tue, 18 Jan 2022 21:38:27 +0200 Message-Id: <83wniwu958.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87o848evkd.fsf@melete.silentflame.com> (message from Sean Whitton on Tue, 18 Jan 2022 11:40:50 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> <87o848evkd.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org > Date: Tue, 18 Jan 2022 11:40:50 -0700 > > > 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. OK, but I don't think I see how this answers my question. Is it possible today to say >foo something or other in Eshell, and have the output of 'something' redirected to 'foo'? If it is possible today, will it be possible after your changes, and what will happen with that if 'something' includes the new "*|" pipe symbol? > > 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. Does this mean that those tests will not run on systems where 'sh' is not available? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 18 18:16:13 2022 Received: (at 46351) by debbugs.gnu.org; 18 Jan 2022 23:16:13 +0000 Received: from localhost ([127.0.0.1]:51947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9xi1-0004p9-3P for submit@debbugs.gnu.org; Tue, 18 Jan 2022 18:16:13 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:55945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9xhw-0004oq-PR for 46351@debbugs.gnu.org; Tue, 18 Jan 2022 18:16:11 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8703B5C03F5; Tue, 18 Jan 2022 18:16:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 18 Jan 2022 18:16:03 -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=tcuNCL97Rs+y65QmEBuMkny510 mH6vCHEp8iCaY2i5Y=; b=3HAeSD5dFQcN/4IuCU+OSMoUzFuyZs+cKw/7x/m2dv orGmHuvncEm1T6lyvJ8JyfukWQ8YZG640VkWBieJcGpM1gVtRrz9rPs5LUF7MkJ+ yXLsnyknR4sKj+BHBpThwYNrjSuMWxtPuB7sUa0Qhk6lGsph6i0dWrEVurzZNOvb FiTp00Dz8R3XtlC8vwfenTSQvASKEtiHcNACCThlLyANndQ1RFYukxrsr2/BxoQM 1RPK8/vIg+XCAfV9g7NZDIeDDH+qDXRMW9icMw1fd0ezJ7uNR6v6x0X+9kJe9Nst CMkzyk7NsOGByk6Sbsc3ZdYGb57IvG8L0ORRC1fVrmiw== 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=tcuNCL 97Rs+y65QmEBuMkny510mH6vCHEp8iCaY2i5Y=; b=aTs69x5P4/agcmD3txihxO OGKnAeMm/37Db4ISdIQRjEo57lJ4x9kZ167gkShbCe1MurrRQ93MO2OoqFlRlUKC N8z1VQhWRigHye0250ZYEK2WFv7Dx4h92/rDoGEQ/RaYRw8RFIBQdGKGBsJ/NU3x 1uiGQ6WXYlL4ULroxk6CJzSlYpvdqBBniB770TJn/dXqtE0z5xKTXA40//mWjhVV jEwxOqVVIKZworVaATkNXZuggYwumJOfRzewCrcKEV3aIz5hgY/Y6si04un6rTub h+zbxNtdFbnKdl+9EniYAT33P0f4qu1S8bg/ym/ctxxGtYqL610HUhVErp9QuwEQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeggddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeeg feetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jan 2022 18:16:02 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 907C77E3C05; Tue, 18 Jan 2022 16:16:01 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83wniwu958.fsf@gnu.org> 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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Tue, 18 Jan 2022 16:16:01 -0700 Message-ID: <87h7a0eitq.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Tue 18 Jan 2022 at 09:38PM +02, Eli Zaretskii wrote: > OK, but I don't think I see how this answers my question. Is it > possible today to say > > >foo something or other > > in Eshell, and have the output of 'something' redirected to 'foo'? If > it is possible today, will it be possible after your changes, and what > will happen with that if 'something' includes the new "*|" pipe > symbol? Interestingly, it's not possible to do that with plain Eshell. If someone modifies Eshell's parsing to make it possible, I do not believe it will interact with em-extpipe.el in any meaningful way. Even though >blah echo "Hello" doesn't work, with my patch, these three do, and all output to "blah": *>blah echo "Hello" echo "Hello" *| cat >blah echo "Hello" *| >blah cat If you do >blah echo "Hello" *| rev then on my system, "blah" contains "Hello", not "olleH", as it looks like GNU bash prioritises the output redirection over the pipe. To answer your question directly, then, if 'something' contains *| then the external shell will be asked to redirect the output of the first command to the file foo and also to pipe it to a second command, and I guess some shells might duplicate the output and others will just choose one destination; maybe POSIX has something to say about it. >> > 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. > > Does this mean that those tests will not run on systems where 'sh' is > not available? No, they will run on any system that Emacs runs on. They test the parsing and rewriting done by em-extpipe.el. Actually executing commands is tested by test/lisp/eshell/eshell-tests.el. Executing the commands is not specific to em-extpipe.el. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 19 02:34:38 2022 Received: (at 46351) by debbugs.gnu.org; 19 Jan 2022 07:34:38 +0000 Received: from localhost ([127.0.0.1]:52221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nA5UM-0001RL-AQ for submit@debbugs.gnu.org; Wed, 19 Jan 2022 02:34:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nA5UJ-0001R8-7G for 46351@debbugs.gnu.org; Wed, 19 Jan 2022 02:34:36 -0500 Received: from [2001:470:142:3::e] (port=59008 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA5UD-0003wg-QZ; Wed, 19 Jan 2022 02:34:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kxcBfd0FQMQpSo6Lr8bD9ASBo3PFdDxGcIjoTexsT+o=; b=TDnPT7tIpIxv 7Vb29frsklQY46nBtRqP+fPq6u9bzqKz0p73fR20MAEn3aKsK8kgqOLVKgXXalrgcemAhRYDK5zK9 vE1SpEfnb1tsGm7yhOxuxKfLEwXVGoGvPDcBQiBm5D7o1vMDZo5vKj4CluXC85mXc5a54b6+PH/qt v+Y+/BONy+3qo69LsyARnODYDm2lJPZgjDYwajBhZcfPOcgJXDyAjlx+vZ7EP2BT9c+AF7FmAwPSH C3pXuT5Gz/4Njz+IwgZ3BqgA3Cz0fJXEdkWdhjzPWlIMM09dv8IZto2LPkOm/oxxuMXp9plAPRhWs qsp5wMYGKgCmoWX07wgiIQ==; Received: from [87.69.77.57] (port=4300 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 1nA5UD-0005Tc-TR; Wed, 19 Jan 2022 02:34:30 -0500 Date: Wed, 19 Jan 2022 09:34:25 +0200 Message-Id: <83lezctbzy.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87h7a0eitq.fsf@melete.silentflame.com> (message from Sean Whitton on Tue, 18 Jan 2022 16:16:01 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> <87h7a0eitq.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org > Date: Tue, 18 Jan 2022 16:16:01 -0700 > > > >foo something or other > > > > in Eshell, and have the output of 'something' redirected to 'foo'? If > > it is possible today, will it be possible after your changes, and what > > will happen with that if 'something' includes the new "*|" pipe > > symbol? > > Interestingly, it's not possible to do that with plain Eshell. If > someone modifies Eshell's parsing to make it possible, I do not believe > it will interact with em-extpipe.el in any meaningful way. If it doesn't work now, then we cannot break it. > Even though > > >blah echo "Hello" > > doesn't work, with my patch, these three do, and all output to "blah": > > *>blah echo "Hello" > echo "Hello" *| cat >blah > echo "Hello" *| >blah cat These work because they delegate to the shell, and the shell does DTRT. > If you do > > >blah echo "Hello" *| rev > > then on my system, "blah" contains "Hello", not "olleH", as it looks > like GNU bash prioritises the output redirection over the pipe. Of course. If you want "olleH" in "blah", you need to do this instead: echo "Hello" *| >blah rev Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 19 10:52:16 2022 Received: (at 46351) by debbugs.gnu.org; 19 Jan 2022 15:52:17 +0000 Received: from localhost ([127.0.0.1]:55308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nADFw-0006hv-Jg for submit@debbugs.gnu.org; Wed, 19 Jan 2022 10:52:16 -0500 Received: from mout.gmx.net ([212.227.17.20]:47907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nADFr-0006hX-As for 46351@debbugs.gnu.org; Wed, 19 Jan 2022 10:52:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1642607521; bh=zCuHRs2ACZG2MTtpk7sJhVsCRDtLhO+io5e3XttcnQw=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ILUxjLi3J7m6HSCeIiOfpKXUWbiutxbg6rKpRgxF1QMgPUHjypl/N6pi/f2Y8RCm1 xxHk6sv2NGT8zS0dTSubHQLCcxo//HBwA+lpe5UG62rG4k4NO6hpHlliz9qeKrR7jZ 2hmmslBAuoiNuM2wciiQ+mbjUZrOGJ0/+oL7qMUw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([212.91.243.252]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M7b6b-1nDmYu23fp-00850F; Wed, 19 Jan 2022 16:52:01 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> Date: Wed, 19 Jan 2022 16:52:00 +0100 In-Reply-To: <87y23dei2o.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 17 Jan 2022 22:19:59 -0700") Message-ID: <87bl07910f.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:T42JiR26wbG8Tqqa9MZNQqv/Vr6jKIFTfM6kvgzq0Wcv5XdFekZ 3+r/BTZ61xdLmAZ4X7MX5SmW8n6ZuaovLPcQvWzkDV4fBxJLO2hAUutKguwXmpmkYyhvL/A 7cOGeXTpcpyWQNt6KUpCUJXOOlMEb5bk+NVVDGoHKiTg6TyGiR2i/iVVE7PI3eE/VnNQ4/L GJOfn0h6dRWLVYsbK6wvQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:XExS00Ug024=:H4e8YTyd3uho8RXLzY7FFG 2CaAscC2D0F03cCaiA5WkTY9jVSCHUV0FKOnVZUe1iSlBCaoS4/eptgJqSZOie2YzpoGoMiel PPhltBLJcrK2Qt5J20lDM5gm2ZO/TOP+/HNy+AIRu0iBwdU8v4vnODJyPJWrPzCDeD1/3ksi2 RPJl8eqaHgPanGioA/I16u4RbRNUttSybwNinvU0DbnCact5Yt4ta8c4Ss+1SC5M80WugGhUW +qCV9nbKNT8/NqSS52HvemJw2PdDSBoKdBzQY7DGhaHjZx7KsceSzClQdD9gyovRTBfetnPfy lztPXGYALwrp1OIqzO1oe8ar1oYMVKgTM5JdCm94K112lJ9aW+oN+pqC+jf31Bb4TncgtnMC8 ZMsiBXYEKuz/dCTu2k6bU4t+B81JYYVyWxesb3ahVG3k0KGCDd8STO2t/JOQJXQesKtPSCktc ZyARPsHMXH+hibyMJqx+AYMshzHIvlFawzOJYMCOWERa1jKNWFszG2e8iUZ+vrfTpMf5OADVw ieagd5n2ybvlDuu9BXcN2Ug/fF7KkH5myrP2Ps85YS8UnDYVeNvH2APJPioW4kgnsqtLrBDdy udIUTilaneBxv64Sgz7BToNNmfvjp66tSEfCUy5MbJ0PDVW2AS+CS+c2ZRqj5YvSXLcGZY7Eq DXKQ8QuB+5olvfLXm8Y6BIEwU5KS7nBItnPqbSIwGHkLUBLC4tTQBb9DI10wRUoMAOEa/oDgJ 41vG2e+s+ggey/JZxKYEt7H+SKDwFSuTCMjP07Yh/b5im4KqQeVWnKAa4exCH1ZXjDEr6+A1n 4VQ9tIuWJpDA10q7q4nwGW8910ipRtv6e0ipslPWUj7QYuSTGGoaWXGbGRBgSN583nk017Ft5 yMba9f9BBjAA0KPtDlvGFkIXw4BXluSPoPa1IA1aQtXwiheIJBQZjnQVczLhX2Fi6dgQXHQeP s6Ks/mj4vx+aCUmCLcVcaq+eBjRJKhVLbqzyLkNdgJikK7QA/9bWqtmCylHGEhPjJwbCxRCvR vLCJ3mGKo0wNLbl3PGbmxJ5pRyl6d+1/QeR2Ndl5Pg2+XkCjn3DqriWAxBoR/ZdIxDbaWbcdB vS7t5XM6Hx2pxU= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Sean Whitton writes: > Hello, Hi Sean, > I've got it working. Please let me know what you think of the attached. Some comments: > --- /dev/null > +++ b/test/lisp/eshell/em-extpipe-tests.el > @@ -0,0 +1,122 @@ > +(load (expand-file-name "eshell-tests" > + (file-name-directory (or load-file-name > + default-directory)))) This is problematic. Loading eshell-tests.el declares also all ert tests which are contained in that file. Running em-extpipe-tests.el in batch would run also all tests from that file, which is not intended I believe. A better approach would be to factor out the helper functions from eshell-tests.el into an own file, and load it here and in eshell-tests.el. > +(cl-macrolet > + ((deftest (name input expected) > + (let ((result (gensym))) > + `(ert-deftest ,name () > + (let* ((shell-file-name "sh") (shell-command-switch "-c") I'm not sure this is the right approach. Why do you change shell-file-name and shell-command-switch? You've spoken in another message about Tramp, but I don't understand this. Tramp has its own machinery to handle them, via connection-local variables. > + (deftest em-extpipe-test-7 Looks like em-extpipe-test-6 is missing. > Sean Whitton Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 19 15:40:08 2022 Received: (at 46351) by debbugs.gnu.org; 19 Jan 2022 20:40:08 +0000 Received: from localhost ([127.0.0.1]:55601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAHkV-0002W2-O8 for submit@debbugs.gnu.org; Wed, 19 Jan 2022 15:40:08 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAHkT-0002Uy-AD for 46351@debbugs.gnu.org; Wed, 19 Jan 2022 15:40:06 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2B59D3202276; Wed, 19 Jan 2022 15:39:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 19 Jan 2022 15:39:59 -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=5PDbusln4wW1vEvMfveBNQ/liB jSzhjsc8ToIwKml6w=; b=NZ4LSnTy841E4mCTDW0+0CMAZexCTr/CC8koi9i1/r ETMOrWAPsgndZCs5OoWTmjUIz2WZsqSL72Yc9RFy1d+IdczfWraFnwp0XbabTI18 C+9qvoYCjiClyrZl9CgO2IIVUS1MlHDm1nbkXIgI756lfKDx3iWm86RAhGV6ZVZl KHZRHHyUgRrIHqEzwhHZW8aJX45UHXsccdMqi5Q9JgsflCChskMR0UfZp4hq8ohx 3otE07kJeNKxAbB4r0Tq4DQtdOeqKbQQlITysonIdbu/YBFqnJTVpJKjMOwZUVMv Ko5eppqx8L4y6w0VUmMyZNGofNW950t1R1e58fAoEwDA== 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=5PDbus ln4wW1vEvMfveBNQ/liBjSzhjsc8ToIwKml6w=; b=Cn5IM3qprmebqD3QEfcYAK ViKY/Cgis/b2lQJMZN031plCPxrtnfFAhc76XKwqjP3IEycMbzWdglqTHHpYRUhE pD0ZlbxAHmGPM47Esv98a4w2OfUCAZpoFCzB3AtgdUOFefhCyl8CWWaYxeIhqvpC AWhY1AiO4Dx8+yQOWYmNR6DeCu7kCcHWckZf0U474uvQetMX5L9X2wRRnzXiP7Vc RaB5rEP825PhDDhfnyXgiQeHG8b/NnW3a/a8kWRWiz9TAORJOCYX23cg3fuQpWZx /ROeCqwsLso6WsRulHCdbQfDYZnISbxSWTHOby62N/aXNJtNv2DBit+V62Zz2ewQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeeg feetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jan 2022 15:39:58 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 5A6A27E0D6E; Wed, 19 Jan 2022 13:39:57 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83lezctbzy.fsf@gnu.org> 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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> <87h7a0eitq.fsf@melete.silentflame.com> <83lezctbzy.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Wed, 19 Jan 2022 13:39:57 -0700 Message-ID: <87r193cvdu.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Wed 19 Jan 2022 at 09:34AM +02, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org >> Date: Tue, 18 Jan 2022 16:16:01 -0700 >> >> > >foo something or other >> > >> > in Eshell, and have the output of 'something' redirected to 'foo'? If >> > it is possible today, will it be possible after your changes, and what >> > will happen with that if 'something' includes the new "*|" pipe >> > symbol? >> >> Interestingly, it's not possible to do that with plain Eshell. If >> someone modifies Eshell's parsing to make it possible, I do not believe >> it will interact with em-extpipe.el in any meaningful way. > > If it doesn't work now, then we cannot break it. Okay, so I should add something to skip over my parsing code in the case that the first thing in the input is a redirection? -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 19 15:54:13 2022 Received: (at 46351) by debbugs.gnu.org; 19 Jan 2022 20:54:13 +0000 Received: from localhost ([127.0.0.1]:55632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAHy9-0002tF-67 for submit@debbugs.gnu.org; Wed, 19 Jan 2022 15:54:13 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAHy7-0002t3-My for 46351@debbugs.gnu.org; Wed, 19 Jan 2022 15:54:12 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 0AF9D32022A6; Wed, 19 Jan 2022 15:54:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 19 Jan 2022 15:54:06 -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=XD/8RdMIhODy4bLTkI9jeiW8Pk N95tjS1OiCNw71c7I=; b=gWx6LRQwq6UI7lqcATp9uYmucwsmCQi2AU5AIDap/B vASJfc7qu2cwjSPuLReQlN5Quulph3y3C/6aSGJIQ/haFnz3B3JcBlNsGYs4sTgm TIWvXmUBXW/iYeONwWGbLHbfWhfTo7iuQklRF+UQSeC+dHkn33axqGSM1l8DCKaI NLLi/cGeY9Qb4TFYlN7VVrjIQz7zTgsevg3GhwmPDOYFH9h01U/SrvU24Q8j/tNo 3o3AKn97eCbv8QSrPypZGqIJ/lbabp4q+MxRYU+0+JsAgftU06Fl+WEG53w2cJA8 /gBmvIyCBrUwHHGxSQrmwnGRmhrG/s0m12cuHBU5uDWA== 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=XD/8Rd MIhODy4bLTkI9jeiW8PkN95tjS1OiCNw71c7I=; b=jYQzb9/dAuFh5Hb4QOTKRD klchkXTdlSSKWMxhBuL6gkqaxgViczH75tqAl0zM9+vO1LNbL32yGeGZCpUhgzBy UXRXA2sP412QTnhN3kI9ElX8WEEeardZwqx7KKmwjVpW2b5NsQgZxUkgjEZ0EBUZ jQqbNn+aTTTbYaO0Jc/yFRGoZIEbfcWrcnIvWqkvLJvhZ1HEfkLSVe4HFepHEef7 R7V7tTBbsezINBxmVE5hDMAlU1jDiByeG3NOYgTAkKjpXZ5PDvs0guMLkCDmvmUT m3iWQDFtZdyKX/RlFcc7MiaqxV1/9lHyhkunckKvl1RdP0Ii9KvVFymr8yVNyvUg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeeg feetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jan 2022 15:54:05 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 6E20C7E0D6E; Wed, 19 Jan 2022 13:54:04 -0700 (MST) From: Sean Whitton To: Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87bl07910f.fsf@gmx.de> 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> <87bl07910f.fsf@gmx.de> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Wed, 19 Jan 2022 13:54:04 -0700 Message-ID: <87o847cuqb.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Michael, On Wed 19 Jan 2022 at 04:52PM +01, Michael Albinus wrote: >> --- /dev/null >> +++ b/test/lisp/eshell/em-extpipe-tests.el >> @@ -0,0 +1,122 @@ >> +(load (expand-file-name "eshell-tests" >> + (file-name-directory (or load-file-name >> + default-directory)))) > > This is problematic. Loading eshell-tests.el declares also all ert tests > which are contained in that file. Running em-extpipe-tests.el in batch > would run also all tests from that file, which is not intended I believe. > > A better approach would be to factor out the helper functions from > eshell-tests.el into an own file, and load it here and in eshell-tests.el. Good point, I'll factor that out. >> +(cl-macrolet >> + ((deftest (name input expected) >> + (let ((result (gensym))) >> + `(ert-deftest ,name () >> + (let* ((shell-file-name "sh") (shell-command-switch "-c") > > I'm not sure this is the right approach. Why do you change > shell-file-name and shell-command-switch? You've spoken in another > message about Tramp, but I don't understand this. Tramp has its own > machinery to handle them, via connection-local variables. The unit tests are all about seeing whether em-extpipe sets up `eshell-parse-command' to do the right thing. When it comes to shell-file-name and shell-command-switch, however, all em-extpipe does is substitute them in verbatim, using `with-connection-local-variables'. So there isn't much point in varying the values of the two variables in the tests. However, as the values of the two variables show up in the expected return values of `eshell-parse-command' that are part of the test definitions, in order to write the tests, I need to know what those two values will be. It seemed simplest just to bind them to constants. I could instead substitute the actual values of those variables into the expected return values. It seems to me that would sacrifice readability of the tests, though. Am I perhaps missing some other benefit? >> + (deftest em-extpipe-test-7 > > Looks like em-extpipe-test-6 is missing. Oops, will fix. Many thanks for the review. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 20 01:54:03 2022 Received: (at 46351) by debbugs.gnu.org; 20 Jan 2022 06:54:03 +0000 Received: from localhost ([127.0.0.1]:56114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nARKc-0003l0-Vq for submit@debbugs.gnu.org; Thu, 20 Jan 2022 01:54:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nARKa-0003kT-QG for 46351@debbugs.gnu.org; Thu, 20 Jan 2022 01:54:01 -0500 Received: from [2001:470:142:3::e] (port=35678 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nARKU-0005eu-IK; Thu, 20 Jan 2022 01:53:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=U0OowiAv4PTHCf/i1ZTt9foG7dMk92DPv4loVnVMqKY=; b=GkFgLi3yItrG aMi/0KeCPWKVLbR2dCT11Dt/G+RWQ9I2y/3hRBE+jQV77lEP7apBQ3ODi/KFurVVMSIFy4s18JM+x lyfJ/Hs8nBGt6zMIAaBwaN7CscUjn4JYbOwmtjL0ZAlnutdrQqU60oP+IJmnwMHbirOW2OEZyj1u0 7qUIgMg4ZbUhIi1eW5yGCh8AUTbmXXtxGI3jnrs3mwvLpu413lCkrhVt7IaARdp+iOU61IYWkq2vi vAGZOypebGl2lD+W7NBhCuwh42tUp/KuIs9MDk15ml6AvD57Nf3yeFnHJivzJd9sIgrIXayWSEol7 Vd9OKvsRILhfmGoZoCND0A==; Received: from [87.69.77.57] (port=3729 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 1nARKT-0007kl-VH; Thu, 20 Jan 2022 01:53:54 -0500 Date: Thu, 20 Jan 2022 08:53:51 +0200 Message-Id: <83sftirj7k.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87r193cvdu.fsf@melete.silentflame.com> (message from Sean Whitton on Wed, 19 Jan 2022 13:39:57 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> <87h7a0eitq.fsf@melete.silentflame.com> <83lezctbzy.fsf@gnu.org> <87r193cvdu.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org > Date: Wed, 19 Jan 2022 13:39:57 -0700 > > >> > >foo something or other > >> > > >> > in Eshell, and have the output of 'something' redirected to 'foo'? If > >> > it is possible today, will it be possible after your changes, and what > >> > will happen with that if 'something' includes the new "*|" pipe > >> > symbol? > >> > >> Interestingly, it's not possible to do that with plain Eshell. If > >> someone modifies Eshell's parsing to make it possible, I do not believe > >> it will interact with em-extpipe.el in any meaningful way. > > > > If it doesn't work now, then we cannot break it. > > Okay, so I should add something to skip over my parsing code in the case > that the first thing in the input is a redirection? I'm not sure I understand the intent: what do you want to accomplish by this special handling? From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 20 13:41:50 2022 Received: (at 46351) by debbugs.gnu.org; 20 Jan 2022 18:41:50 +0000 Received: from localhost ([127.0.0.1]:59175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAcNa-0002lJ-Ai for submit@debbugs.gnu.org; Thu, 20 Jan 2022 13:41:50 -0500 Received: from mout.gmx.net ([212.227.17.20]:55009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAcNY-0002l4-FX for 46351@debbugs.gnu.org; Thu, 20 Jan 2022 13:41:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1642704099; bh=+1D/DPSDCrfhT+FT0wrh/lcy6nkW8e5LHlrZePHnaZ4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Keqb4jNuZoEoN71QPw4hDMLAg/IBmq+xi66aFXIWgxzWgHeqQXBLT7CT1o0tWUN7t Ah0iDsjB0j5EMCY9HF+GANynkmE/6E8c/I87ngWLBze1M5eNN13v9fNyvjYQ2FHpOw JkvJ975JUHrDeygjXVOuDzTUvfneblLxoSMJmrgQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([213.220.156.132]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M9Wuq-1nG89v1IJw-005WVy; Thu, 20 Jan 2022 19:41:39 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining 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> <87bl07910f.fsf@gmx.de> <87o847cuqb.fsf@melete.silentflame.com> Date: Thu, 20 Jan 2022 19:41:38 +0100 In-Reply-To: <87o847cuqb.fsf@melete.silentflame.com> (Sean Whitton's message of "Wed, 19 Jan 2022 13:54:04 -0700") Message-ID: <87h79ymeql.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:m1p23f0AXh+3k5VFxdim5NcWj+v8XV1yMg9NdjFX0dkxReCpBVT yauG89T87Th5JC5UZcxsR8zsuYlfpAIDhH0H8fPCgbpaLSSAAiLx4pQvEo4KEZCK0tWa+Lq 9xX0K2zgZaQt6kj8bAXo9euQ2J3pkusGK7diBF7w1zxXE+Qn+4O9YV7hKwa1s7MP6bhP54I ytWQBbzyNP57A6v0bJnQw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wgWpUvWkFl8=:j/69nhD08blEb9to/5H4kY eKQClXC1azzxCNgAK8EIAJReCQfpv4NRBoLgpB+7pLPR9+0y86K6xDlnnSN5qhMuAGmdzrDum 3MZ89kDUnP0NiPd60IIxwHhcQWueiiPaaavh09qCZQJuMuuGsadGGZHizsnq9SwDwV0NoE6HT tAvl5b4hnb/9oaox9pfgOncX6nZQISB3mPS9PpAizVaIvPtkIJRBL532bjLwYXGP/5BSzutBo DvKnxwc9dGMjoJr9mXD6rFhDJDDyu47sTnFDu9LIv+TZ1q50uH7T7Tb6wtYTXh5twlkdvqp5H 8lUGVNUm6jm1j9KhHUdjKq6NvHrb1oYfR5FmQww/eL4AOlFqMLbzZsDOwr8QcVd1mYxJNyo29 TOjO9n3spBJRrqbCSiQUTkrLhnj0PbJx6kdflgVJRrYu0VoouoOXKON7SWr9+spSM2RAP1CJ9 UlIaN6bdLjypHZMQPhhjEEzqerj//OGhGVLsKE49wm1R3DWV2fR9Zx4ZY1jLBfNefWflMr22C L+z9rmlpqedNuPxdP3RF/njRWrUasPf5W6mQqZllolIE+zp4VXnVD7f1xLvOshL8MsKTo143q jAhD2Ab8ZH2wXUcXfv1Ytk4gLRGg5hOpEHHmbIuPOtcr2vZ9A4pAhrGGfTve7hzWDHr0TUMoU R4SnCjiFkhzW5/2AqHASDEJoh+flZS7KuGEr/wRIDUzFioMX0Gc0/0gh70eYQxYl9reXhuZH9 /fEDqzUJ9k2myKfTkJmDT1EEhE6wfJgP/7D+hniv4I9MndHMUw3/UdV4tuP9zZm/N0+mVvoBL F/6bIyiVFcgAeaEj89jF9OT52n9ycRR9+ZSrpyiXYEixXYLVW9o4Agk7bySK/WK9G2/b2ziKF jiIMRMJ4sl8Joj9tkZzyRanoXGGzMh7sR0ktBNwRSqKYuXcu1iOY48jfEgDQMMRmPGKI+SeiK wqd7+b3EtiTdix/9xD4rDtSfWo2fKofmMD+uQItU87XkHhiV89IS87ZEHFTsyrnZlyoIsnVLC 3zt81Q8ci4tLsQiYGAbBD1TA+yU53ztkRhlroY9LEXBVmuhKWQofxuL1oBGTtHoEjc9Oq1ADz oUUR8zmwC5mByE= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Sean Whitton writes: > Hello Michael, Hi Sean, > I could instead substitute the actual values of those variables into the > expected return values. It seems to me that would sacrifice readability > of the tests, though. Am I perhaps missing some other benefit? I understand your intentions, they are OK. However, if I understand your test cases, they check that the eshell commands are manipulated as you expect. The tests do not run the resulting command itself, checking the output. This is a little bit unfortune, because you could check that the output is indeed what you expect. And perhaps you could find some constellations, where the output is different when using either *| or |. This would be another proof that your changes work. And this would also give some guidance, where your approach has limitations (if exist). Showing also *failing* tests in one way or another is always a benefit. Your tests use only should, there is no should-not or should-error. Another benefit of testing working examples and their output is documentation. I always have trouble to understand documentation of unknown (to me) features in Emacs. I have the attitude to run the respective ert tests, and to study how the feature is applied by its developer. Often, it is more instructive than documentation, and I can steal the code. > Many thanks for the review. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 20 17:16:32 2022 Received: (at 46351) by debbugs.gnu.org; 20 Jan 2022 22:16:32 +0000 Received: from localhost ([127.0.0.1]:59577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAfjL-0002Kh-Qe for submit@debbugs.gnu.org; Thu, 20 Jan 2022 17:16:32 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:50983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAfjJ-0002KR-8L for 46351@debbugs.gnu.org; Thu, 20 Jan 2022 17:16:30 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 6CB563201FD3; Thu, 20 Jan 2022 17:16:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 20 Jan 2022 17:16:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=CrB47PQ+fLi/BEwdMc7lOwICEQ2gnn 4SZUYXzJp7bto=; b=jX+YPoMweLi2XmVYpagd0FwbYjgdZKo/4mpaVII7golYZB LPbLPGnsfiFqCiVQAS24ovAVebAbmtBqbSoBcV6MTREWFdAaolWq3L0jxaGIVPmZ knOWYBt13dhKlY2C2vkVa7l2UzB53TuIUDv0xj6HF33l4Jojj8zbfHGJobE2ouNB e1yyIp/ljv5yie0kALE41BPku+QDhDdKI6BxwGaYUwlP/aISUwR0re7p4r/JVzMb MS31aQ2kl0qj0sozg9TggqJzXGpPU0EzrTwNhhKbEiqz/qwVA1l8fi0Wx8/acwlv ZrKQKSMkiuHiVkLcuz/PCRD+Ee6oHIodQI/k8FEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=CrB47PQ+fLi/BEwdM c7lOwICEQ2gnn4SZUYXzJp7bto=; b=U3CkUt7Wb8jY7syPSXzwSsTAH5OluUK1A VkrwDFCWpYNFqdmNa/SeqHx40hTuJMO55TFarCFhYIIU16l8jMcTnb7CGJ4k8Lsi I+8NHywOS/4ravAhsZW6r1vaf/LCB0w/D1zl/Bnblpz8d3qKb+lYukCqoI+hz+u/ KLRhIdeAFoSJnEwLN0HhAd2CJGfcYkU1ZjluAEQOmP0hbu+fLKyCvIEsnhXSq7im LHunh7eiIP3jNmpPdeOLNoU00NKpnqeY9NSJcXYXFHX7X2EfZReVvGq+b+suw3gX 1ToBcxlcBgksmxtQxKyoFnoeL+tpR0nG/P8mhaxVt67GghPyoq9+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekgdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Jan 2022 17:16:21 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id BC3F57E087F; Thu, 20 Jan 2022 15:16:20 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83sftirj7k.fsf@gnu.org> References: <878s812c6a.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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> <87h7a0eitq.fsf@melete.silentflame.com> <83lezctbzy.fsf@gnu.org> <87r193cvdu.fsf@melete.silentflame.com> <83sftirj7k.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Thu, 20 Jan 2022 15:16:20 -0700 Message-ID: <87ilueaw97.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Thu 20 Jan 2022 at 08:53AM +02, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org >> Date: Wed, 19 Jan 2022 13:39:57 -0700 >> >> >> > >foo something or other >> >> > >> >> > in Eshell, and have the output of 'something' redirected to 'foo'? If >> >> > it is possible today, will it be possible after your changes, and what >> >> > will happen with that if 'something' includes the new "*|" pipe >> >> > symbol? >> >> >> >> Interestingly, it's not possible to do that with plain Eshell. If >> >> someone modifies Eshell's parsing to make it possible, I do not believe >> >> it will interact with em-extpipe.el in any meaningful way. >> > >> > If it doesn't work now, then we cannot break it. >> >> Okay, so I should add something to skip over my parsing code in the case >> that the first thing in the input is a redirection? > > I'm not sure I understand the intent: what do you want to accomplish > by this special handling? Perhaps I misunderstood your earlier message. I thought that you were saying that because Eshell does not support redirections at the very beginning of the line at present, my new syntax should not support that either, to prevent confusion. Did you mean something else when you wrote "if it doesn't work now, then we cannot break it?" Thanks! -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 20 17:17:57 2022 Received: (at 46351) by debbugs.gnu.org; 20 Jan 2022 22:17:57 +0000 Received: from localhost ([127.0.0.1]:59583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAfkj-0002Mt-6y for submit@debbugs.gnu.org; Thu, 20 Jan 2022 17:17:57 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:46923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAfki-0002Mh-76 for 46351@debbugs.gnu.org; Thu, 20 Jan 2022 17:17:56 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7A2523200927; Thu, 20 Jan 2022 17:17:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 20 Jan 2022 17:17:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=1zEQd2SXjOwRZmFcCpmI6ExGJFUnGM y6pwr9KA0IhHI=; b=Ugyo6SW6DqjCgDyb0epzklI8WnCf8cVyknBw7qjHDF1/H9 ChMusmeE/VA0auPOb5wYYl9z8E8bqBV84Xb1aK6t6KqrgvQ7devvFYMoI7SDWe4z LSrmPWHGEJo5jD6QSLrKoTQ+cOgopTNsFAqT1hA/MZk5HfzD+yBOMieqCJ4sn+rb jam7IJTwym3+vND0xMVYvmYoeB8K6rNk4OJ/FQ+/DAT8mc2hjlpnhTzwt0JTWVbB 7x46uTFQAZ44e/FAibZ4WyUomFf8JdFsbCPwPwEF8+ES3nRquSlDf6+O4ivxdj0b ZZCdUaEBMcNUph0gXpuC7GxhMpNOMC9bL7nfYbfg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=1zEQd2SXjOwRZmFcC pmI6ExGJFUnGMy6pwr9KA0IhHI=; b=nU3mA2629urmNFp11lXa4km18c+QrXTgc vdpyjd4pmY5RA5ce8OhCiQ2Pzak3Twc175eicGZRJglgZiTHNXt4goHJuJHbsy3l n/7ox9qTnv4e9FVUfsaSf9kEF43chAXQtitJW86pzJ909oSezzkogBj3rjugU9cE a6IVH5q5ioCSbjnk+TQvJzdFi+PXNUGsu1J7c/u7j2DSBoTBLlQPr52bobvxozV2 OlOsYhmS3P4KFq6F5MhRvxPoj1nrqBBsDHLqF+/9Ehhgc6UIkTjAK3GSVo70huGf TbaHmQbxRuQFKni18WiTm+21p50m8udLzk3oxCKVuIY4JhJUGDGVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekgdduheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepleeggefgvdeijedvhfdugfegtefgkeekueeileejjeehudeg geefteeghfeuffeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Jan 2022 17:17:49 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 27BAD7E087F; Thu, 20 Jan 2022 15:17:49 -0700 (MST) From: Sean Whitton To: Michael Albinus Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87h79ymeql.fsf@gmx.de> 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> <87bl07910f.fsf@gmx.de> <87o847cuqb.fsf@melete.silentflame.com> <87h79ymeql.fsf@gmx.de> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Thu, 20 Jan 2022 15:17:49 -0700 Message-ID: <87fspiaw6q.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Thu 20 Jan 2022 at 07:41PM +01, Michael Albinus wrote: > However, if I understand your test cases, they check that the eshell > commands are manipulated as you expect. The tests do not run the > resulting command itself, checking the output. This is a little bit > unfortune, because you could check that the output is indeed what you > expect. And perhaps you could find some constellations, where the output > is different when using either *| or |. This would be another proof that > your changes work. > > And this would also give some guidance, where your approach has > limitations (if exist). Showing also *failing* tests in one way or > another is always a benefit. Your tests use only should, there is no > should-not or should-error. > > Another benefit of testing working examples and their output is > documentation. I always have trouble to understand documentation of > unknown (to me) features in Emacs. I have the attitude to run the > respective ert tests, and to study how the feature is applied by its > developer. Often, it is more instructive than documentation, and I can > steal the code. I hadn't thought of tests as specifically useful alongside documentation. Thank you. I will include some additional tests of this nature in my next revision. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 21 01:54:24 2022 Received: (at 46351) by debbugs.gnu.org; 21 Jan 2022 06:54:24 +0000 Received: from localhost ([127.0.0.1]:60042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAnoV-0001Se-Ma for submit@debbugs.gnu.org; Fri, 21 Jan 2022 01:54:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAnoU-0001SS-6a for 46351@debbugs.gnu.org; Fri, 21 Jan 2022 01:54:22 -0500 Received: from [2001:470:142:3::e] (port=34774 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAnoO-0004d8-Bh; Fri, 21 Jan 2022 01:54:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ERIzDK6eA32tM6741U76VLOWDrUa2K7lWdy6m3/ST7Y=; b=MZkdkpVBtYrK z201CGB/o6Y2Y+ah9lbBFIZNeZVyPd4CoxXs3QePkkBoDgmsxgulEKIf3YTABjUlUj+B7Enxy18Ox ytzFOpJdOOQUQvJeGtDvZnaWhmEmack+BjRDfnVP2Vx12bFn0wbcV9noL6gml7+mumX28/KfaXcaJ FazwvUcBgF17FAS0OIswofcsGuFS367VFuQSkCzskteWzCkQ75+Kk5IuQ14bjjHJf7OyFmUpOXiGJ +iSsON4ZMRtYYOhgZiaRKPv4MHeogfBrJMYEmcf3Xebpg24ZwTxjCUiY21fcI6iS1eaY6iTdScib1 pJLdSNMr/Z2sV5Ocfj7yjw==; Received: from [87.69.77.57] (port=1386 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 1nAnoN-000809-55; Fri, 21 Jan 2022 01:54:16 -0500 Date: Fri, 21 Jan 2022 08:54:15 +0200 Message-Id: <83iludpoiw.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87ilueaw97.fsf@melete.silentflame.com> (message from Sean Whitton on Thu, 20 Jan 2022 15:16:20 -0700) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <878s812c6a.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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> <87h7a0eitq.fsf@melete.silentflame.com> <83lezctbzy.fsf@gnu.org> <87r193cvdu.fsf@melete.silentflame.com> <83sftirj7k.fsf@gnu.org> <87ilueaw97.fsf@melete.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org > Date: Thu, 20 Jan 2022 15:16:20 -0700 > > >> Okay, so I should add something to skip over my parsing code in the case > >> that the first thing in the input is a redirection? > > > > I'm not sure I understand the intent: what do you want to accomplish > > by this special handling? > > Perhaps I misunderstood your earlier message. I thought that you were > saying that because Eshell does not support redirections at the very > beginning of the line at present, my new syntax should not support that > either, to prevent confusion. Did you mean something else when you > wrote "if it doesn't work now, then we cannot break it?" I meant that if Eshell doesn't support that syntax, you can do whatever you want in that case. You don't need to make any effort to support it, and you don't need to make any effort not to support it: whatever your code does in that case will be OK. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 21 19:16:57 2022 Received: (at 46351) by debbugs.gnu.org; 22 Jan 2022 00:16:57 +0000 Received: from localhost ([127.0.0.1]:35354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nB45R-0003S4-3J for submit@debbugs.gnu.org; Fri, 21 Jan 2022 19:16:57 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:59859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nB45O-0003Rp-ET for 46351@debbugs.gnu.org; Fri, 21 Jan 2022 19:16:56 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 5B2063200929; Fri, 21 Jan 2022 19:16:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 21 Jan 2022 19:16:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=ef2zDX6WDlVtE+DwZxBSTjP27QaH+V wO5WpvmQbC08A=; b=PLbsV4rPlj5WCfbcrj56zn/kHH2m3+UocUx+0b3vUbhnGn 0NjayrpyJG9Kvdh7cfksBNS9iGlvo54I663wdzQqkkXffyg7FLbrv0/8pUqtbgr8 eqgi253AdtZ2Zsi18LJzQ1GgJx+cJC7zfEsV9QBHDsZCv9r0F6RFyhWpAkMkzlp5 qYAcqwGqK06oxnq0SXsy8NO5StIPXNMTPf71NzDi+tbPvBuumM1ERatQjvTSbj48 C/YIKnMd7+b9x08MfFsQkFjXAu9AO89TJ3Xf0mvL2quxfbees3mDt3upIimfh3Xk H7LuGw+ehz7tFEGBq8GcokZGKgrN2x6FyhcUjeiw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=ef2zDX6WDlVtE+DwZ xBSTjP27QaH+VwO5WpvmQbC08A=; b=Ky19r0EvBty7+p1air5clvEgQbDti55qv eDJcH/xEAzfxRJJkvtWm+GbutKShCgY6K0x7sHsixpwfW1JP+knKG/CUpe/cb8/+ 0Uz6mU86chE6SbzZnqObZi23lg58zmBbWY6BjldEza+K8yh2IYi5EXSb/qBYOPuG z6NPN68O83J1PtTtjwSnnwj65PfvjIMyJAd5KnLbOBGtxztQatzbyQmn26bcO7XE vd54zg3ETQ7cruXfDnv3QWZh8nw9H5NpWiFEKr/c4t1CsNSGu9zNzJPbM8JXcTUh b8h/9kD9xaA9Haf7TYjcPo67zxdvP7/GDr3qs3z8owhS9WVK0fQjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddugddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeeg feetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Jan 2022 19:16:47 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id D04297E154C; Fri, 21 Jan 2022 17:16:46 -0700 (MST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <83iludpoiw.fsf@gnu.org> References: <878s812c6a.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> <87o848evkd.fsf@melete.silentflame.com> <83wniwu958.fsf@gnu.org> <87h7a0eitq.fsf@melete.silentflame.com> <83lezctbzy.fsf@gnu.org> <87r193cvdu.fsf@melete.silentflame.com> <83sftirj7k.fsf@gnu.org> <87ilueaw97.fsf@melete.silentflame.com> <83iludpoiw.fsf@gnu.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Fri, 21 Jan 2022 17:16:46 -0700 Message-ID: <87wnishbf5.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Fri 21 Jan 2022 at 08:54AM +02, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: michael.albinus@gmx.de, 46351@debbugs.gnu.org >> Date: Thu, 20 Jan 2022 15:16:20 -0700 >> >> >> Okay, so I should add something to skip over my parsing code in the case >> >> that the first thing in the input is a redirection? >> > >> > I'm not sure I understand the intent: what do you want to accomplish >> > by this special handling? >> >> Perhaps I misunderstood your earlier message. I thought that you were >> saying that because Eshell does not support redirections at the very >> beginning of the line at present, my new syntax should not support that >> either, to prevent confusion. Did you mean something else when you >> wrote "if it doesn't work now, then we cannot break it?" > > I meant that if Eshell doesn't support that syntax, you can do > whatever you want in that case. You don't need to make any effort to > support it, and you don't need to make any effort not to support it: > whatever your code does in that case will be OK. Ah, okay, I see now. Thanks. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 23 17:39:16 2022 Received: (at 46351) by debbugs.gnu.org; 23 Jan 2022 22:39:16 +0000 Received: from localhost ([127.0.0.1]:41500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBlVz-0004SN-13 for submit@debbugs.gnu.org; Sun, 23 Jan 2022 17:39:16 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:34811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBlVv-0004S7-IZ for 46351@debbugs.gnu.org; Sun, 23 Jan 2022 17:39:13 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7DD89320152C; Sun, 23 Jan 2022 17:39:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 23 Jan 2022 17:39:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; bh=fY4zJZUg303geRs38i7T54W5slxOS7D6YCOFi1 jlmAg=; b=OmnAlrFMY21OcJbe1vGTmJpQiTqqLxJHGBZ30xgICJf9JKjcEeD2Fu 2xGp1qDmsQE3UzFnZxPgZ0imsmx7aNPqWkaY9DPO4W06oc6P5MnUVy6INGVi31dg lYaWI+GTFQRXR5SR0AO4l48UZzwlcR57Hpgs3BBhyFHSOFGbv939lJciNi8B6VyV XGH9rgnF83mzGl2FsT1SPpI+AFG/+b1ZTuyiuw/TyCBjXEqTM71DMqvfeNy9m4zq q7T0rM7UabKg3VUT0flwvQtyX7HyxkAbCdm790V/w7tuLoMua39xhp6BozkMCvam 5ns5OdelKlCWQwjNoHiEJLccuEDgf91A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=fY4zJZUg303geRs38i7T54W5slxOS 7D6YCOFi1jlmAg=; b=koX4CR/JGEmgtmFWMc/03fqHMz66kI5Tm2Lw0TDHkhAUu aaa2HSo9qtlP/hTUj65PCz8HRV2PnZKfv0PZrR57UgWT2BTLDQvVsN6vb/uyhpLz s/8OVRlDaxYg0K31sSIywBT4+WQNuDIJFkeC3v2Xjug4Ht2J0TTcVBpusYpQ+4NH VAOuAA137h4uJYgRlb4OVhJG5btuHZW2bMWlohG+Yzg/euDgjVnE0fPbKwQZ9Kzq 9qzYG5lZnOTXxoFV+giGShck1HnFBNTm79OvugBOpG37TkzmIUkM3ff7en+XkMSa NpLmUQyeH0wW7in+M3WXlf1ESWST6C6Z5OjNTl53w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdehucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh ephffvufgjfffkgggtsehmtddtredttddtnecuhfhrohhmpefuvggrnhcuhghhihhtthho nhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqnecuggftrfgrth htvghrnhepleefffdvvefhgfehudeugefggfeffedvvdffuedvvdelgffghfffleehheet ffehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsh hpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jan 2022 17:39:04 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id ECBC47E0FD1; Sun, 23 Jan 2022 15:39:03 -0700 (MST) From: Sean Whitton To: Michael Albinus , 46351@debbugs.gnu.org Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87y23dei2o.fsf@melete.silentflame.com> Date: Sun, 23 Jan 2022 15:39:02 -0700 Message-ID: <8735lersah.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: Robert Pluim , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Mon 17 Jan 2022 at 10:19PM -07, Sean Whitton wrote: > I've got it working. Please let me know what you think of the attached. Attached is a revised series addressing feedback gratefully received over the past week. On Thu 20 Jan 2022 at 07:41PM +01, Michael Albinus wrote: > However, if I understand your test cases, they check that the eshell > commands are manipulated as you expect. The tests do not run the > resulting command itself, checking the output. This is a little bit > unfortune, because you could check that the output is indeed what you > expect. And perhaps you could find some constellations, where the output > is different when using either *| or |. This would be another proof that > your changes work. > > And this would also give some guidance, where your approach has > limitations (if exist). Showing also *failing* tests in one way or > another is always a benefit. Your tests use only should, there is no > should-not or should-error. I've added actually running the commands and examining the results to several of the tests. I found a way to show different output in the case of *| vs. | by using cl-letf to redefine some Lisp functions. I also refactored the tests in the hope of increasing their value as a supplement to the documentation. Please let me know if you have any other ideas. Thanks! -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0001-Move-Eshell-test-helpers-to-their-own-file.patch >From 1cfae74bbf78093c84bebaa6dc97bc887238287c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Jan 2022 22:32:22 -0700 Subject: [PATCH v4 1/3] Move Eshell test helpers to their own file * test/lisp/eshell/eshell-tests.el: * test/lisp/eshell/eshell-tests-helpers.el: Move helpers to own file. --- test/lisp/eshell/eshell-tests-helpers.el | 90 ++++++++++++++++++++++++ test/lisp/eshell/eshell-tests.el | 61 +++------------- 2 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 test/lisp/eshell/eshell-tests-helpers.el diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el new file mode 100644 index 0000000000..2afa63ae51 --- /dev/null +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -0,0 +1,90 @@ +;;; eshell-tests-helpers.el --- Eshell test suite helpers -*- lexical-binding:t -*- + +;; Copyright (C) 1999-2022 Free Software Foundation, Inc. + +;; Author: John Wiegley + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Eshell test suite helpers. + +;;; Code: + +(require 'ert) +(require 'ert-x) +(require 'esh-mode) +(require 'eshell) + +(defvar eshell-test--max-subprocess-time 5 + "The maximum amount of time to wait for a subprocess to finish, in seconds. +See `eshell-wait-for-subprocess'.") + +(defmacro with-temp-eshell (&rest body) + "Evaluate BODY in a temporary Eshell buffer." + `(ert-with-temp-directory eshell-directory-name + (let* (;; We want no history file, so prevent Eshell from falling + ;; back on $HISTFILE. + (process-environment (cons "HISTFILE" process-environment)) + (eshell-history-file-name nil) + (eshell-buffer (eshell t))) + (unwind-protect + (with-current-buffer eshell-buffer + ,@body) + (let (kill-buffer-query-functions) + (kill-buffer eshell-buffer)))))) + +(defun eshell-wait-for-subprocess () + "Wait until there is no interactive subprocess running in Eshell. +If this takes longer than `eshell-test--max-subprocess-time', +raise an error." + (let ((start (current-time))) + (while (eshell-interactive-process) + (when (> (float-time (time-since start)) + eshell-test--max-subprocess-time) + (error "timed out waiting for subprocess")) + (sit-for 0.1)))) + +(defun eshell-insert-command (text &optional func) + "Insert a command at the end of the buffer." + (goto-char eshell-last-output-end) + (insert-and-inherit text) + (funcall (or func 'eshell-send-input))) + +(defun eshell-match-result (regexp) + "Check that text after `eshell-last-input-end' matches REGEXP." + (goto-char eshell-last-input-end) + (should (string-match-p regexp (buffer-substring-no-properties + (point) (point-max))))) + +(defun eshell-command-result-p (text regexp &optional func) + "Insert a command at the end of the buffer." + (eshell-insert-command text func) + (eshell-wait-for-subprocess) + (eshell-match-result regexp)) + +(defvar eshell-history-file-name) + +(defun eshell-test-command-result (command) + "Like `eshell-command-result', but not using HOME." + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + (eshell-command-result command)))) + +(provide 'eshell-tests) + +;;; eshell-tests.el ends here diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 1a7ab0ab06..6aeefdfde2 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -29,61 +29,16 @@ (require 'ert-x) (require 'esh-mode) (require 'eshell) - -(defvar eshell-test--max-subprocess-time 5 - "The maximum amount of time to wait for a subprocess to finish, in seconds. -See `eshell-wait-for-subprocess'.") - -(defmacro with-temp-eshell (&rest body) - "Evaluate BODY in a temporary Eshell buffer." - `(ert-with-temp-directory eshell-directory-name - (let* (;; We want no history file, so prevent Eshell from falling - ;; back on $HISTFILE. - (process-environment (cons "HISTFILE" process-environment)) - (eshell-history-file-name nil) - (eshell-buffer (eshell t))) - (unwind-protect - (with-current-buffer eshell-buffer - ,@body) - (let (kill-buffer-query-functions) - (kill-buffer eshell-buffer)))))) - -(defun eshell-wait-for-subprocess () - "Wait until there is no interactive subprocess running in Eshell. -If this takes longer than `eshell-test--max-subprocess-time', -raise an error." - (let ((start (current-time))) - (while (eshell-interactive-process) - (when (> (float-time (time-since start)) - eshell-test--max-subprocess-time) - (error "timed out waiting for subprocess")) - (sit-for 0.1)))) - -(defun eshell-insert-command (text &optional func) - "Insert a command at the end of the buffer." - (goto-char eshell-last-output-end) - (insert-and-inherit text) - (funcall (or func 'eshell-send-input))) - -(defun eshell-match-result (regexp) - "Check that text after `eshell-last-input-end' matches REGEXP." - (goto-char eshell-last-input-end) - (should (string-match-p regexp (buffer-substring-no-properties - (point) (point-max))))) - -(defun eshell-command-result-p (text regexp &optional func) - "Insert a command at the end of the buffer." - (eshell-insert-command text func) - (eshell-wait-for-subprocess) - (eshell-match-result regexp)) +(eval-and-compile + (load (expand-file-name "eshell-tests-helpers" + (file-name-directory (or load-file-name + default-directory))))) (defvar eshell-history-file-name) - -(defun eshell-test-command-result (command) - "Like `eshell-command-result', but not using HOME." - (ert-with-temp-directory eshell-directory-name - (let ((eshell-history-file-name nil)) - (eshell-command-result command)))) +(defvar eshell-test--max-subprocess-time) +(declare-function eshell-insert-command "eshell-tests-helpers") +(declare-function eshell-match-result "eshell-tests-helpers") +(declare-function eshell-command-result-p "eshell-tests-helpers") ;;; Tests: -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0002-Rework-eshell-match-result-for-testing-asynchrono.patch >From 7d8dc8906973371fe5ce38f676bba39d57af17cc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 22 Jan 2022 18:54:55 -0700 Subject: [PATCH v4 2/3] Rework eshell-match-result for testing asynchronous commands When using eshell-match-result via eshell-command-result-p to examine the output of asynchronous Eshell commands, a newly emitted prompt is included in the text against which the regexp is matched. This makes it awkward to match against the whole output; for example, to check whether it is empty. Rework the function to exclude the prompt. * test/lisp/eshell/eshell-tests-helpers.el (eshell-match-result): Exclude any newly emitted prompt from the text against which the regexp is matched. Additionally, the function no longer moves point. * test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Update and simplify test given how eshell-match-result no longer moves point. --- test/lisp/eshell/eshell-tests-helpers.el | 9 +++++---- test/lisp/eshell/eshell-tests.el | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el index 2afa63ae51..a150adb144 100644 --- a/test/lisp/eshell/eshell-tests-helpers.el +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -66,10 +66,11 @@ eshell-insert-command (funcall (or func 'eshell-send-input))) (defun eshell-match-result (regexp) - "Check that text after `eshell-last-input-end' matches REGEXP." - (goto-char eshell-last-input-end) - (should (string-match-p regexp (buffer-substring-no-properties - (point) (point-max))))) + "Check that output of last command matches REGEXP." + (should + (string-match-p + regexp (buffer-substring-no-properties + (eshell-beginning-of-output) (eshell-end-of-output))))) (defun eshell-command-result-p (text regexp &optional func) "Insert a command at the end of the buffer." diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 6aeefdfde2..542815df80 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -232,9 +232,8 @@ eshell-test/flush-output (with-temp-eshell (eshell-insert-command "echo alpha") (eshell-kill-output) - (eshell-match-result (regexp-quote "*** output flushed ***\n")) - (should (forward-line)) - (should (= (point) eshell-last-output-start)))) + (eshell-match-result + (concat "^" (regexp-quote "*** output flushed ***\n") "$")))) (ert-deftest eshell-test/run-old-command () "Re-run an old command" -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0003-Add-Eshell-syntax-to-more-easily-bypass-Eshell-s-.patch >From f12e596aa3112397a26ad9675ca1de091f04c140 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 Jan 2022 15:15:36 -0700 Subject: [PATCH v4 3/3] Add Eshell syntax to more easily bypass Eshell's own pipelining * etc/NEWS: * doc/misc/eshell.texi (Input/Output): Document the new syntax. * lisp/eshell/em-extpipe.el: New module. * test/lisp/eshell/em-extpipe-tests.el: New tests. * lisp/eshell/esh-module.el (eshell-modules-list): Add `eshell-extpipe'. --- doc/misc/eshell.texi | 42 ++++++ etc/NEWS | 10 ++ lisp/eshell/em-extpipe.el | 183 ++++++++++++++++++++++++ lisp/eshell/esh-module.el | 1 + test/lisp/eshell/em-extpipe-tests.el | 205 +++++++++++++++++++++++++++ 5 files changed, 441 insertions(+) create mode 100644 lisp/eshell/em-extpipe.el create mode 100644 test/lisp/eshell/em-extpipe-tests.el diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index df6e3b861e..261e88d00c 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1142,6 +1142,48 @@ Input/Output The output function is called once on each line of output until @code{nil} is passed, indicating end of output. +@section Running Shell Pipelines Natively +When constructing shell pipelines that will move a lot of data, it is +a good idea to bypass Eshell's own pipelining support and use the +operating system shell's instead. This is especially relevant when +executing commands on a remote machine using Eshell's Tramp +integration: using the remote shell's pipelining avoids copying the +data which will flow through the pipeline to local Emacs buffers and +then right back again. + +Eshell recognises a special syntax to make it easier to convert +pipelines so as to bypass Eshell's pipelining. Prefixing at least one +@code{|}, @code{<} or @code{>} with an asterisk marks a command as +intended for the operating system shell. To make it harder to invoke +this functionality accidentally, it is also required that the asterisk +be preceded by whitespace or located at the start of input. For +example, + +@example + cat *.ogg *| my-cool-decoder >file +@end example + +Executing this command will not copy all the data in the *.ogg files, +nor the decoded data, into Emacs buffers, as would normally happen. + +The command is interpreted as extending up to the next @code{|} +character which is not preceded by an unescaped asterisk following +whitespace, or the end of the input if there is no such character. +Thus, all @code{<} and @code{>} redirections occuring before the next +asterisk-unprefixed @code{|} are implicitly prefixed with (whitespace +and) asterisks. An exception is that Eshell-specific redirects right +at the end of the command are excluded. This allows input like this: + +@example + foo *| baz ># +@end example + +@noindent which is equivalent to input like this: + +@example + sh -c "foo | baz" ># +@end example + @node Extension modules @chapter Extension modules Eshell provides a facility for defining extension modules so that they diff --git a/etc/NEWS b/etc/NEWS index 5297db3e2d..68c0eba866 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -858,6 +858,16 @@ the Galeon web browser was released in September, 2008. *** New user option 'ruby-toggle-block-space-before-parameters'. +** Eshell + ++++ +*** New feature to easily bypass Eshell's own pipelining. +Prefixing '|', '<' or '>' with an asterisk, i.e. '*|', '*<' or '*>', +will cause the whole command to be passed to the operating system +shell. This is particularly useful to bypass Eshell's own pipelining +support for pipelines which will move a lot of data. See "Running +Shell Pipelines Natively" in the Eshell manual. + ** Miscellaneous --- diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el new file mode 100644 index 0000000000..57aeec38ff --- /dev/null +++ b/lisp/eshell/em-extpipe.el @@ -0,0 +1,183 @@ +;;; em-extpipe.el --- external shell pipelines -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; When constructing shell pipelines that will move a lot of data, it +;; is a good idea to bypass Eshell's own pipelining support and use +;; the operating system shell's instead. This module tries to make +;; that easy to do. + +;;; Code: + +(require 'cl-lib) +(require 'esh-arg) +(require 'esh-io) +(require 'esh-util) + +(eval-when-compile (require 'files-x)) + +;;; Functions: + +(defun eshell-extpipe-initialize () ;Called from `eshell-mode' via intern-soft! + "Initialize external pipelines support." + (when (boundp 'eshell-special-chars-outside-quoting) + (setq-local + eshell-special-chars-outside-quoting + (append eshell-special-chars-outside-quoting (list ?\*)))) + (add-hook 'eshell-parse-argument-hook + #'eshell-parse-external-pipeline -20 t) + (add-hook 'eshell-pre-rewrite-command-hook + #'eshell-rewrite-external-pipeline -20 t)) + +(defun eshell-parse-external-pipeline () + "Parse a pipeline intended for execution by the external shell. + +A sequence of arguments is rewritten to use the operating system +shell when it contains `*|', `*<' or `*>', where the asterisk is +preceded by whitespace or located at the start of input. + +The command extends to the next `|' character which is not +preceded by an unescaped asterisk following whitespace, or the +end of input, except that any Eshell-specific output redirections +occurring at the end are excluded. Any other `<' or `>' +appearing before the end of the command are treated as though +preceded by (whitespace and) an asterisk. + +For example, + + foo # + +is equivalent to + + sh -c \"foo # + +when `shell-file-name' is `sh' and `shell-command-switch' is +`-c', but in + + foo ># *| baz + +and + + foo *| baz ># --some-argument + +the Eshell-specific redirect will be passed on to the operating +system shell, probably leading to undesired results. + +This function must appear early in `eshell-parse-argument-hook' +to ensure that operating system shell syntax is not interpreted +as though it were Eshell syntax." + ;; Our goal is to wrap the external command to protect it from the + ;; other members of `eshell-parse-argument-hook'. We must avoid + ;; misinterpreting a quoted `*|', `*<' or `*>' as indicating an + ;; external pipeline, hence the structure of the loop in `findbeg1'. + (cl-flet + ((findbeg1 (pat &optional go (bound (point-max))) + (let* ((start (point)) + (result + (catch 'found + (while (> bound (point)) + (let* ((found + (save-excursion + (re-search-forward "['\"\\]" bound t))) + (next (or (and found (match-beginning 0)) + bound))) + (if (re-search-forward pat next t) + (throw 'found (match-beginning 1)) + (goto-char next) + (while (or (eshell-parse-backslash) + (eshell-parse-double-quote) + (eshell-parse-literal-quote))))))))) + (goto-char (if (and result go) (match-end 0) start)) + result))) + (unless (or eshell-current-argument eshell-current-quoted) + (let ((beg (point)) end + (next-marked (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*[|<>]\\)")) + (next-unmarked + (or (findbeg1 "\\(?:\\=\\|[^*]\\|\\S-\\*\\)\\(|\\)") + (point-max)))) + (when (and next-marked (> next-unmarked next-marked) + (or (> next-marked (point)) + (looking-back "\\`\\|\\s-" nil))) + ;; Skip to the final segment of the external pipeline. + (while (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*|\\)" t)) + ;; Find output redirections. + (while (findbeg1 + "\\([0-9]?>+&?[0-9]?\\s-*\\S-\\)" t next-unmarked) + ;; Is the output redirection Eshell-specific? We have our + ;; own logic, rather than calling `eshell-parse-argument', + ;; to avoid specifying here all the possible cars of + ;; parsed special references -- `get-buffer-create' etc. + (forward-char -1) + (let ((this-end + (save-match-data + (cond ((looking-at "#<") + (forward-char 1) + (1+ (eshell-find-delimiter ?\< ?\>))) + ((and (looking-at "/\\S-+") + (assoc (match-string 0) + eshell-virtual-targets)) + (match-end 0)))))) + (cond ((and this-end end) + (goto-char this-end)) + (this-end + (goto-char this-end) + (setq end (match-beginning 0))) + (t + (setq end nil))))) + ;; We've moved past all Eshell-specific output redirections + ;; we could find. If there is only whitespace left, then + ;; `end' is right before redirections we should exclude; + ;; otherwise, we must include everything. + (unless (and end (skip-syntax-forward "\s" next-unmarked) + (= next-unmarked (point))) + (setq end next-unmarked)) + (let ((cmd (string-trim + (buffer-substring-no-properties beg end)))) + (goto-char end) + ;; We must now drop the asterisks, unless quoted/escaped. + (with-temp-buffer + (insert cmd) + (goto-char (point-min)) + (cl-loop + for next = (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*[|<>]\\)" t) + while next do (forward-char -2) (delete-char 1)) + (eshell-finish-arg + `(eshell-external-pipeline ,(buffer-string)))))))))) + +(defun eshell-rewrite-external-pipeline (terms) + "Rewrite an external pipeline in TERMS as parsed by +`eshell-parse-external-pipeline', which see." + (while terms + (when (and (listp (car terms)) + (eq (caar terms) 'eshell-external-pipeline)) + (with-connection-local-variables + (setcdr terms (cl-list* + shell-command-switch (cadar terms) (cdr terms))) + (setcar terms shell-file-name))) + (setq terms (cdr terms)))) + +(defsubst eshell-external-pipeline (&rest _args) + "Stub to generate an error if a pipeline is not rewritten." + (error "Unhandled external pipeline in input text")) + +(provide 'em-extpipe) +;;; esh-extpipe.el ends here diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index ade151d7cd..14e91912d1 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -54,6 +54,7 @@ eshell-modules-list eshell-basic eshell-cmpl eshell-dirs + eshell-extpipe eshell-glob eshell-hist eshell-ls diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el new file mode 100644 index 0000000000..2c3f11522b --- /dev/null +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -0,0 +1,205 @@ +;;; em-extpipe-tests.el --- em-extpipe test suite -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + + +;;; Code: + +(require 'cl-lib) +(require 'ert) +(require 'ert-x) +(require 'em-extpipe) +(eval-and-compile + (load (expand-file-name "eshell-tests-helpers" + (file-name-directory (or load-file-name + default-directory))))) + +(defvar eshell-history-file-name) +(defvar eshell-test--max-subprocess-time) +(declare-function eshell-command-result-p "eshell-tests-helpers") + +(defmacro em-extpipe-tests--deftest (name input &rest body) + (declare (indent 2)) + `(ert-deftest ,name () + (cl-macrolet + ((should-parse (expected) + `(let ((shell-file-name "sh") + (shell-command-switch "-c")) + ;; Strip `eshell-trap-errors'. + (should (equal ,expected + (cadr (eshell-parse-command input)))))) + (with-substitute-for-temp (&rest body) + ;; Substitute name of an actual temporary file and/or + ;; buffer into `input'. The substitution logic is + ;; appropriate for only the use we put it to in this file. + `(ert-with-temp-file temp + (let ((temp-buffer (generate-new-buffer " *temp*" t))) + (unwind-protect + (let ((input + (replace-regexp-in-string + "temp\\([^>]\\|\\'\\)" temp + (string-replace "#" + (buffer-name temp-buffer) + input)))) + ,@body) + (when (buffer-name temp-buffer) + (kill-buffer temp-buffer)))))) + (temp-should-string= (expected) + `(string= ,expected (string-trim-right + (with-temp-buffer + (insert-file-contents temp) + (buffer-string))))) + (temp-buffer-should-string= (expected) + `(string= ,expected (string-trim-right + (with-current-buffer temp-buffer + (buffer-string)))))) + (skip-unless shell-file-name) + (skip-unless shell-command-switch) + (skip-unless (executable-find shell-file-name)) + (let ((input ,input)) + (with-temp-eshell ,@body))))) + +(em-extpipe-tests--deftest em-extpipe-test-1 + "echo \"bar\" *| rev >temp" + (skip-unless (executable-find "rev")) + (should-parse '(eshell-named-command + "sh" (list "-c" "echo \"bar\" | rev >temp"))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-2 + "echo \"bar\" | rev *>temp" + (skip-unless (executable-find "rev")) + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "echo" (list (eshell-escape-arg "bar"))) + (eshell-named-command "sh" (list "-c" "rev >temp"))))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-3 "foo *| bar | baz -d" + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "sh" (list "-c" "foo | bar")) + (eshell-named-command "baz" (list "-d")))))) + +(em-extpipe-tests--deftest em-extpipe-test-4 + "echo \"bar\" *| rev >#" + (skip-unless (executable-find "rev")) + (should-parse + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "temp"))) + (eshell-named-command "sh" + (list "-c" "echo \"bar\" | rev")))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-buffer-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-5 + "foo *| bar ># baz" + (should-parse '(eshell-named-command + "sh" (list "-c" "foo | bar ># baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-6 + "foo ># *| bar baz" + (should-parse '(eshell-named-command + "sh" (list "-c" "foo ># | bar baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-7 + "foo *| bar ># >>#" + (should-parse + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "quux"))) + (ignore + (eshell-set-output-handle 1 'append + (get-process "other"))) + (eshell-named-command "sh" + (list "-c" "foo | bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-8 + "foo *| bar >/dev/kill | baz" + (should-parse + '(eshell-execute-pipeline + '((progn + (ignore + (eshell-set-output-handle 1 'overwrite "/dev/kill")) + (eshell-named-command "sh" + (list "-c" "foo | bar"))) + (eshell-named-command "baz"))))) + +(em-extpipe-tests--deftest em-extpipe-test-9 "foo \\*| bar" + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "foo" + (list (eshell-escape-arg "*"))) + (eshell-named-command "bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-10 "foo \"*|\" *>bar" + (should-parse + '(eshell-named-command "sh" (list "-c" "foo \"*|\" >bar")))) + +(em-extpipe-tests--deftest em-extpipe-test-11 "foo '*|' bar" + (should-parse '(eshell-named-command + "foo" (list (eshell-escape-arg "*|") "bar")))) + +(em-extpipe-tests--deftest em-extpipe-test-12 ">foo bar *| baz" + (should-parse + '(eshell-named-command "sh" (list "-c" ">foo bar | baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-13 "foo*|bar" + (should-parse '(eshell-execute-pipeline + '((eshell-named-command (concat "foo" "*")) + (eshell-named-command "bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-14 "tac *) id 1nBw4E-0002gA-SW for submit@debbugs.gnu.org; Mon, 24 Jan 2022 04:55:19 -0500 Received: from quimby.gnus.org ([95.216.78.240]:48666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBw4D-0002fs-DP for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 04:55:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pwm6az7cEzcSPkudfO4SfYlcNb5ZZj05Dlv7kvWWYrM=; b=eAbmbJlCFV3eX1hwChybvkh/0/ 7bwSkL1Z0Cq0NS0mk1a3zQBUzpeErBegbDcrkqowE24fqtwDMBp4pngxcSELchDBFtaRkHSxi3WRX m6A74IQQF6sOs/17DedUFvFYdkjQP6IYunpre0P1lgJPI0hRgEyVzaI2qAUdn3is1VtU=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nBw43-0006Wd-2g; Mon, 24 Jan 2022 10:55:09 +0100 From: Lars Ingebrigtsen To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <878s812c6a.fsf@melete.silentflame.com> <8735lersah.fsf@melete.silentflame.com> X-Now-Playing: The The's _Infected_: "Out Of The Blue (Into The Fire)" Date: Mon, 24 Jan 2022 10:55:06 +0100 In-Reply-To: <8735lersah.fsf@melete.silentflame.com> (Sean Whitton's message of "Sun, 23 Jan 2022 15:39:02 -0700") Message-ID: <874k5t4fwl.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sean Whitton writes: > I've added actually running the commands and examining the results to > several of the tests. I found a way to show different output in the > case of *| vs. | by using cl-letf to redefine some Lisp [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > I've added actually running the commands and examining the results to > several of the tests. I found a way to show different output in the > case of *| vs. | by using cl-letf to redefine some Lisp functions. This leads to: Test em-extpipe-test-14 condition: (ert-test-failed ((should (string-match-p regexp (buffer-substring-no-properties ... ...))) :form (string-match-p "baz\nbar" "bazbar\n") :value nil)) FAILED 6/16 em-extpipe-test-14 (0.119788 sec) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 09:19:06 2022 Received: (at 46351) by debbugs.gnu.org; 24 Jan 2022 14:19:06 +0000 Received: from localhost ([127.0.0.1]:42667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC0BW-0005vK-3z for submit@debbugs.gnu.org; Mon, 24 Jan 2022 09:19:06 -0500 Received: from mout.gmx.net ([212.227.17.20]:54503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC0BU-0005uf-Dy for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 09:19:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1643033934; bh=FHnrpxQS7U26YtZ2dgqDV6vrKVqDnEyNROCae7YRY0c=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=FpDdhBYTbnkfrR7ELQa3BcNS8culkQvqO8hwrPSztym+iBfRr2PsFsND48ZxkO9dZ e0fnVdI3y9hED2iMw+/ApLrJX31LRcLCJwxTHTcnUTCbZEN7DDfiOrtMAXdAxSgwO4 mz/yIvdlcE/L1LtpBntYEDEzW+hD2BRb8uchrivM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.118.216]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N4hvb-1mAvPe3sPP-011mhG; Mon, 24 Jan 2022 15:18:54 +0100 From: Michael Albinus To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <8735lersah.fsf@melete.silentflame.com> Date: Mon, 24 Jan 2022 15:18:52 +0100 In-Reply-To: <8735lersah.fsf@melete.silentflame.com> (Sean Whitton's message of "Sun, 23 Jan 2022 15:39:02 -0700") Message-ID: <87pmohrzcj.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:NK38iQzZ6UmMw9NKvu8ClW5b5iIUTsmVa3pIetIKEic0cnZzV4Z hLcM7KNdlb7xho1Pozq1NjvDHd44trY+PIDyUbuwyeJNRn7YDrJsx3X6EBdnf91pt+qv4s0 c+xGws17+uUelZJaSPtwUEU2aT0YU5Oj+V6yLjofnFsEJoSkZqkhm5tNtx4/vxBI3cTvT9Q zUY2ZHZmAlMcwMNHS0Z4w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vIRA0etLssA=:1wCV5bO7ydCeXGy/l3ZWxG VZHsY35eVNy8l6ObGnPrtfKEXKp4fmUURwZVsuPXG2r3s+mySoeyVIoRnikXTqcJDQwYvsRF+ t/gfreR3oD4ISyPxPsgQSmVURtugfkl+4nxY3c9JLoxXCZhnEtuy7HUizIm5wRfxVUcZMmKEZ X90HA4bli7kh9Y+Fom73+JG90vcnmZA7UI7S1Qb8pKj2vE3WtBdDRklnaGnVbSW3BV++AKdhu RxkJpbfJ8TssrLK7cKFTG/0wpZMxVJ0ZkR7SpeVlD/r6Y6chI2x3O4ZZ+RYihEBgEjeUpeQc9 XbPNOy9Bl2ZsecS2wb0uDCgbPclx7FEMCTqsHEMWbE4A/nhKwCq7FGQiAQgdbH7JVi3Zn8+mW MRx1eb6QXS/Rdp7OLp8V5um8QZvebC8cMIwKY75r4HMTTPTulpw3eNO1ia7/k1gh8JpT8brcK TfuPTLCV4uEqEYu4+MWdR41vU0VonNtVRC1wPPceum2IjodLRCdej5Sv2tK9ncs2CbLYnyEOq VA2bHYgaGSnqX0N7Uv6X0BGJZ0TaQ3Nka5KQ3Qoyo+F4KWgppCPPDagH1sIHrXSOaMfqpSLyp IZu0oD9dw0c6ffMOA9kMLM+HjFWrQgoa2UAvXcESPPeEzjv9n1ryQqq394s6yoYqLwzu7TRSE OOH1hiyWkK7lEAj2dLK7XXhYO2NLh89pqxybFWVYkVoAsnk+Hfayb0ZW1kkoqogY05zDPUczI o26bXH/f6ErHZOqckkMHYy08rtu2eIUxoUSxnmMGJcQS+pnIixVO4R8f9vE1NwobEP0ydl7yo BOL8H7Y5Ztt6TlSJQf2BfnpK5/S17SNWLh1cSL0EVWxMiKD4kBMq8g9x9yZv8tczFwdQmdKpW BzSG0NzqUd2frWBo0jZLoq55MS5urtzU0EcSeu97lEH0ZHQLiknVHnte0/6hKbl6DkfBWn75R aB+xTsuIa3eUpq/IXcRXRKDx3paPh822p98lPOmNWqLEsqT6JgHYvSluFzJJWPVJoruhLtVdM bVVO9+kGS5olynOFPN6/B4ugx7PhL5BIdDPix4w4HcHVgZoe+BDi3dJKIrGn0Ge43LBbUlv/M fWSRjmJ3vuFRoY= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Sean Whitton writes: > Hello, Hi Sean, > I've added actually running the commands and examining the results to > several of the tests. I found a way to show different output in the > case of *| vs. | by using cl-letf to redefine some Lisp functions. > > I also refactored the tests in the hope of increasing their value as a > supplement to the documentation. Please let me know if you have any > other ideas. Thanks! Thanks. Besides the problem reported by Lars, just a minor comment: > --- /dev/null > +++ b/test/lisp/eshell/eshell-tests-helpers.el > @@ -0,0 +1,90 @@ > +(provide 'eshell-tests) > + > +;;; eshell-tests.el ends here This shall be eshell-tests-helpers in both cases. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 15:33:10 2022 Received: (at 46351) by debbugs.gnu.org; 24 Jan 2022 20:33:10 +0000 Received: from localhost ([127.0.0.1]:46019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC61U-0003yb-QG for submit@debbugs.gnu.org; Mon, 24 Jan 2022 15:33:10 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:33195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC61R-0003y5-II for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 15:33:07 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 815BF3200258; Mon, 24 Jan 2022 15:32:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 24 Jan 2022 15:32:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=9IsXLYtsgiWtwwhJZLjjdNFoLxnhWR INmsRWGAXxt0s=; b=Rf2Dws0UHoVWuaJa+vwL8FMRbR04zrmRIFH1aloG0VMaDK B65U/Ho5fb8Kbx/YUfuln2Jip7OO7qQyGNqBeqi/2wHfoMIMkzr41oDePpVD+nqM lqeujDC7xsRqBKeesJ6qO9JKiFvOmssnwjAVDM2qVVDB8TPMbYjzqUvkzokIBo+n Tt4blpk2DUDy4lMoNk3qJvwNVeoN0k89w4fldTpeT2kfqa6o/Wc2KQPXtBDkuKB1 U9Nth/g7xSMvYUR27KqDumXuUvYn8DW+bIItjDw1I6KJ/XEgvWu+hqg8lirStrwy zgK533fR9uB/pnc2cu8dDzwaj4q2VBfG+2KnFKxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=9IsXLYtsgiWtwwhJZ LjjdNFoLxnhWRINmsRWGAXxt0s=; b=L5UWi2KF8YrQ+QzaJtnfWSDE8wlc1vcQO A6+DxVElWH6vpzhlMr/lvSk6si1et0c4nQBqmPnN3HWodqZBcy8NCNoHWValuOfj P0iHZnmGAoVCbR8b0C4TQ94deQPc+PaQIkDW0lF/7dllrlG3LHf0GnTr511cfzdo YsUyuUEJPlyumHc29n9TZz9uE25hNG35LIOveIqzQiy4iklNQzPoAkMwS+dc93Xs 5vBk6DxEh1XC85K/vco7akM9hn0URXsrEOXFoI1ht2mYCmvSzrkALR0k7RrNO0K3 WKHoq7eFAqMebRamcntiHabQSO8RqA17W+xhu2zrlObxgAYcyPWHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdejgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfetvdfg hfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jan 2022 15:32:58 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 7BB6B7E556C; Mon, 24 Jan 2022 13:32:57 -0700 (MST) From: Sean Whitton To: Michael Albinus , Lars Ingebrigtsen Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87pmohrzcj.fsf@gmx.de> References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 24 Jan 2022 13:32:57 -0700 Message-ID: <87zgnkj2me.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Mon 24 Jan 2022 at 10:55AM +01, Lars Ingebrigtsen wrote: > This leads to: > > Test em-extpipe-test-14 condition: > (ert-test-failed > ((should > (string-match-p regexp > (buffer-substring-no-properties ... ...))) > :form > (string-match-p "baz\nbar" "bazbar\n") > :value nil)) > FAILED 6/16 em-extpipe-test-14 (0.119788 sec) I apologies for neglecting to run the tests in batch mode. There was an implicit dependency on my setting for require-final-newline. Now fixed. On Mon 24 Jan 2022 at 03:18PM +01, Michael Albinus wrote: >> --- /dev/null >> +++ b/test/lisp/eshell/eshell-tests-helpers.el >> @@ -0,0 +1,90 @@ >> +(provide 'eshell-tests) >> + >> +;;; eshell-tests.el ends here > > This shall be eshell-tests-helpers in both cases. Likewise fixed in the attached. Thank you both. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v5-0001-Move-Eshell-test-helpers-to-their-own-file.patch >From 1cfae74bbf78093c84bebaa6dc97bc887238287c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Jan 2022 22:32:22 -0700 Subject: [PATCH v5 1/3] Move Eshell test helpers to their own file * test/lisp/eshell/eshell-tests.el: * test/lisp/eshell/eshell-tests-helpers.el: Move helpers to own file. --- test/lisp/eshell/eshell-tests-helpers.el | 90 ++++++++++++++++++++++++ test/lisp/eshell/eshell-tests.el | 61 +++------------- 2 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 test/lisp/eshell/eshell-tests-helpers.el diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el new file mode 100644 index 0000000000..2afa63ae51 --- /dev/null +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -0,0 +1,90 @@ +;;; eshell-tests-helpers.el --- Eshell test suite helpers -*- lexical-binding:t -*- + +;; Copyright (C) 1999-2022 Free Software Foundation, Inc. + +;; Author: John Wiegley + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Eshell test suite helpers. + +;;; Code: + +(require 'ert) +(require 'ert-x) +(require 'esh-mode) +(require 'eshell) + +(defvar eshell-test--max-subprocess-time 5 + "The maximum amount of time to wait for a subprocess to finish, in seconds. +See `eshell-wait-for-subprocess'.") + +(defmacro with-temp-eshell (&rest body) + "Evaluate BODY in a temporary Eshell buffer." + `(ert-with-temp-directory eshell-directory-name + (let* (;; We want no history file, so prevent Eshell from falling + ;; back on $HISTFILE. + (process-environment (cons "HISTFILE" process-environment)) + (eshell-history-file-name nil) + (eshell-buffer (eshell t))) + (unwind-protect + (with-current-buffer eshell-buffer + ,@body) + (let (kill-buffer-query-functions) + (kill-buffer eshell-buffer)))))) + +(defun eshell-wait-for-subprocess () + "Wait until there is no interactive subprocess running in Eshell. +If this takes longer than `eshell-test--max-subprocess-time', +raise an error." + (let ((start (current-time))) + (while (eshell-interactive-process) + (when (> (float-time (time-since start)) + eshell-test--max-subprocess-time) + (error "timed out waiting for subprocess")) + (sit-for 0.1)))) + +(defun eshell-insert-command (text &optional func) + "Insert a command at the end of the buffer." + (goto-char eshell-last-output-end) + (insert-and-inherit text) + (funcall (or func 'eshell-send-input))) + +(defun eshell-match-result (regexp) + "Check that text after `eshell-last-input-end' matches REGEXP." + (goto-char eshell-last-input-end) + (should (string-match-p regexp (buffer-substring-no-properties + (point) (point-max))))) + +(defun eshell-command-result-p (text regexp &optional func) + "Insert a command at the end of the buffer." + (eshell-insert-command text func) + (eshell-wait-for-subprocess) + (eshell-match-result regexp)) + +(defvar eshell-history-file-name) + +(defun eshell-test-command-result (command) + "Like `eshell-command-result', but not using HOME." + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + (eshell-command-result command)))) + +(provide 'eshell-tests) + +;;; eshell-tests.el ends here diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 1a7ab0ab06..6aeefdfde2 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -29,61 +29,16 @@ (require 'ert-x) (require 'esh-mode) (require 'eshell) - -(defvar eshell-test--max-subprocess-time 5 - "The maximum amount of time to wait for a subprocess to finish, in seconds. -See `eshell-wait-for-subprocess'.") - -(defmacro with-temp-eshell (&rest body) - "Evaluate BODY in a temporary Eshell buffer." - `(ert-with-temp-directory eshell-directory-name - (let* (;; We want no history file, so prevent Eshell from falling - ;; back on $HISTFILE. - (process-environment (cons "HISTFILE" process-environment)) - (eshell-history-file-name nil) - (eshell-buffer (eshell t))) - (unwind-protect - (with-current-buffer eshell-buffer - ,@body) - (let (kill-buffer-query-functions) - (kill-buffer eshell-buffer)))))) - -(defun eshell-wait-for-subprocess () - "Wait until there is no interactive subprocess running in Eshell. -If this takes longer than `eshell-test--max-subprocess-time', -raise an error." - (let ((start (current-time))) - (while (eshell-interactive-process) - (when (> (float-time (time-since start)) - eshell-test--max-subprocess-time) - (error "timed out waiting for subprocess")) - (sit-for 0.1)))) - -(defun eshell-insert-command (text &optional func) - "Insert a command at the end of the buffer." - (goto-char eshell-last-output-end) - (insert-and-inherit text) - (funcall (or func 'eshell-send-input))) - -(defun eshell-match-result (regexp) - "Check that text after `eshell-last-input-end' matches REGEXP." - (goto-char eshell-last-input-end) - (should (string-match-p regexp (buffer-substring-no-properties - (point) (point-max))))) - -(defun eshell-command-result-p (text regexp &optional func) - "Insert a command at the end of the buffer." - (eshell-insert-command text func) - (eshell-wait-for-subprocess) - (eshell-match-result regexp)) +(eval-and-compile + (load (expand-file-name "eshell-tests-helpers" + (file-name-directory (or load-file-name + default-directory))))) (defvar eshell-history-file-name) - -(defun eshell-test-command-result (command) - "Like `eshell-command-result', but not using HOME." - (ert-with-temp-directory eshell-directory-name - (let ((eshell-history-file-name nil)) - (eshell-command-result command)))) +(defvar eshell-test--max-subprocess-time) +(declare-function eshell-insert-command "eshell-tests-helpers") +(declare-function eshell-match-result "eshell-tests-helpers") +(declare-function eshell-command-result-p "eshell-tests-helpers") ;;; Tests: -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v5-0002-Rework-eshell-match-result-for-testing-asynchrono.patch >From 7d8dc8906973371fe5ce38f676bba39d57af17cc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 22 Jan 2022 18:54:55 -0700 Subject: [PATCH v5 2/3] Rework eshell-match-result for testing asynchronous commands When using eshell-match-result via eshell-command-result-p to examine the output of asynchronous Eshell commands, a newly emitted prompt is included in the text against which the regexp is matched. This makes it awkward to match against the whole output; for example, to check whether it is empty. Rework the function to exclude the prompt. * test/lisp/eshell/eshell-tests-helpers.el (eshell-match-result): Exclude any newly emitted prompt from the text against which the regexp is matched. Additionally, the function no longer moves point. * test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Update and simplify test given how eshell-match-result no longer moves point. --- test/lisp/eshell/eshell-tests-helpers.el | 9 +++++---- test/lisp/eshell/eshell-tests.el | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el index 2afa63ae51..a150adb144 100644 --- a/test/lisp/eshell/eshell-tests-helpers.el +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -66,10 +66,11 @@ eshell-insert-command (funcall (or func 'eshell-send-input))) (defun eshell-match-result (regexp) - "Check that text after `eshell-last-input-end' matches REGEXP." - (goto-char eshell-last-input-end) - (should (string-match-p regexp (buffer-substring-no-properties - (point) (point-max))))) + "Check that output of last command matches REGEXP." + (should + (string-match-p + regexp (buffer-substring-no-properties + (eshell-beginning-of-output) (eshell-end-of-output))))) (defun eshell-command-result-p (text regexp &optional func) "Insert a command at the end of the buffer." diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 6aeefdfde2..542815df80 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -232,9 +232,8 @@ eshell-test/flush-output (with-temp-eshell (eshell-insert-command "echo alpha") (eshell-kill-output) - (eshell-match-result (regexp-quote "*** output flushed ***\n")) - (should (forward-line)) - (should (= (point) eshell-last-output-start)))) + (eshell-match-result + (concat "^" (regexp-quote "*** output flushed ***\n") "$")))) (ert-deftest eshell-test/run-old-command () "Re-run an old command" -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v5-0003-Add-Eshell-syntax-to-more-easily-bypass-Eshell-s-.patch >From abd8fd9b6ea7936c56cde538202c7f3eeb24aa76 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 Jan 2022 15:15:36 -0700 Subject: [PATCH v5 3/3] Add Eshell syntax to more easily bypass Eshell's own pipelining * etc/NEWS: * doc/misc/eshell.texi (Input/Output): Document the new syntax. * lisp/eshell/em-extpipe.el: New module (Bug#46351). * test/lisp/eshell/em-extpipe-tests.el: New tests. * lisp/eshell/esh-module.el (eshell-modules-list): Add `eshell-extpipe'. --- doc/misc/eshell.texi | 42 +++++ etc/NEWS | 10 ++ lisp/eshell/em-extpipe.el | 183 ++++++++++++++++++++ lisp/eshell/esh-module.el | 1 + test/lisp/eshell/em-extpipe-tests.el | 205 +++++++++++++++++++++++ test/lisp/eshell/eshell-tests-helpers.el | 4 +- 6 files changed, 443 insertions(+), 2 deletions(-) create mode 100644 lisp/eshell/em-extpipe.el create mode 100644 test/lisp/eshell/em-extpipe-tests.el diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index df6e3b861e..261e88d00c 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1142,6 +1142,48 @@ Input/Output The output function is called once on each line of output until @code{nil} is passed, indicating end of output. +@section Running Shell Pipelines Natively +When constructing shell pipelines that will move a lot of data, it is +a good idea to bypass Eshell's own pipelining support and use the +operating system shell's instead. This is especially relevant when +executing commands on a remote machine using Eshell's Tramp +integration: using the remote shell's pipelining avoids copying the +data which will flow through the pipeline to local Emacs buffers and +then right back again. + +Eshell recognises a special syntax to make it easier to convert +pipelines so as to bypass Eshell's pipelining. Prefixing at least one +@code{|}, @code{<} or @code{>} with an asterisk marks a command as +intended for the operating system shell. To make it harder to invoke +this functionality accidentally, it is also required that the asterisk +be preceded by whitespace or located at the start of input. For +example, + +@example + cat *.ogg *| my-cool-decoder >file +@end example + +Executing this command will not copy all the data in the *.ogg files, +nor the decoded data, into Emacs buffers, as would normally happen. + +The command is interpreted as extending up to the next @code{|} +character which is not preceded by an unescaped asterisk following +whitespace, or the end of the input if there is no such character. +Thus, all @code{<} and @code{>} redirections occuring before the next +asterisk-unprefixed @code{|} are implicitly prefixed with (whitespace +and) asterisks. An exception is that Eshell-specific redirects right +at the end of the command are excluded. This allows input like this: + +@example + foo *| baz ># +@end example + +@noindent which is equivalent to input like this: + +@example + sh -c "foo | baz" ># +@end example + @node Extension modules @chapter Extension modules Eshell provides a facility for defining extension modules so that they diff --git a/etc/NEWS b/etc/NEWS index 5297db3e2d..68c0eba866 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -858,6 +858,16 @@ the Galeon web browser was released in September, 2008. *** New user option 'ruby-toggle-block-space-before-parameters'. +** Eshell + ++++ +*** New feature to easily bypass Eshell's own pipelining. +Prefixing '|', '<' or '>' with an asterisk, i.e. '*|', '*<' or '*>', +will cause the whole command to be passed to the operating system +shell. This is particularly useful to bypass Eshell's own pipelining +support for pipelines which will move a lot of data. See "Running +Shell Pipelines Natively" in the Eshell manual. + ** Miscellaneous --- diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el new file mode 100644 index 0000000000..57aeec38ff --- /dev/null +++ b/lisp/eshell/em-extpipe.el @@ -0,0 +1,183 @@ +;;; em-extpipe.el --- external shell pipelines -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; When constructing shell pipelines that will move a lot of data, it +;; is a good idea to bypass Eshell's own pipelining support and use +;; the operating system shell's instead. This module tries to make +;; that easy to do. + +;;; Code: + +(require 'cl-lib) +(require 'esh-arg) +(require 'esh-io) +(require 'esh-util) + +(eval-when-compile (require 'files-x)) + +;;; Functions: + +(defun eshell-extpipe-initialize () ;Called from `eshell-mode' via intern-soft! + "Initialize external pipelines support." + (when (boundp 'eshell-special-chars-outside-quoting) + (setq-local + eshell-special-chars-outside-quoting + (append eshell-special-chars-outside-quoting (list ?\*)))) + (add-hook 'eshell-parse-argument-hook + #'eshell-parse-external-pipeline -20 t) + (add-hook 'eshell-pre-rewrite-command-hook + #'eshell-rewrite-external-pipeline -20 t)) + +(defun eshell-parse-external-pipeline () + "Parse a pipeline intended for execution by the external shell. + +A sequence of arguments is rewritten to use the operating system +shell when it contains `*|', `*<' or `*>', where the asterisk is +preceded by whitespace or located at the start of input. + +The command extends to the next `|' character which is not +preceded by an unescaped asterisk following whitespace, or the +end of input, except that any Eshell-specific output redirections +occurring at the end are excluded. Any other `<' or `>' +appearing before the end of the command are treated as though +preceded by (whitespace and) an asterisk. + +For example, + + foo # + +is equivalent to + + sh -c \"foo # + +when `shell-file-name' is `sh' and `shell-command-switch' is +`-c', but in + + foo ># *| baz + +and + + foo *| baz ># --some-argument + +the Eshell-specific redirect will be passed on to the operating +system shell, probably leading to undesired results. + +This function must appear early in `eshell-parse-argument-hook' +to ensure that operating system shell syntax is not interpreted +as though it were Eshell syntax." + ;; Our goal is to wrap the external command to protect it from the + ;; other members of `eshell-parse-argument-hook'. We must avoid + ;; misinterpreting a quoted `*|', `*<' or `*>' as indicating an + ;; external pipeline, hence the structure of the loop in `findbeg1'. + (cl-flet + ((findbeg1 (pat &optional go (bound (point-max))) + (let* ((start (point)) + (result + (catch 'found + (while (> bound (point)) + (let* ((found + (save-excursion + (re-search-forward "['\"\\]" bound t))) + (next (or (and found (match-beginning 0)) + bound))) + (if (re-search-forward pat next t) + (throw 'found (match-beginning 1)) + (goto-char next) + (while (or (eshell-parse-backslash) + (eshell-parse-double-quote) + (eshell-parse-literal-quote))))))))) + (goto-char (if (and result go) (match-end 0) start)) + result))) + (unless (or eshell-current-argument eshell-current-quoted) + (let ((beg (point)) end + (next-marked (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*[|<>]\\)")) + (next-unmarked + (or (findbeg1 "\\(?:\\=\\|[^*]\\|\\S-\\*\\)\\(|\\)") + (point-max)))) + (when (and next-marked (> next-unmarked next-marked) + (or (> next-marked (point)) + (looking-back "\\`\\|\\s-" nil))) + ;; Skip to the final segment of the external pipeline. + (while (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*|\\)" t)) + ;; Find output redirections. + (while (findbeg1 + "\\([0-9]?>+&?[0-9]?\\s-*\\S-\\)" t next-unmarked) + ;; Is the output redirection Eshell-specific? We have our + ;; own logic, rather than calling `eshell-parse-argument', + ;; to avoid specifying here all the possible cars of + ;; parsed special references -- `get-buffer-create' etc. + (forward-char -1) + (let ((this-end + (save-match-data + (cond ((looking-at "#<") + (forward-char 1) + (1+ (eshell-find-delimiter ?\< ?\>))) + ((and (looking-at "/\\S-+") + (assoc (match-string 0) + eshell-virtual-targets)) + (match-end 0)))))) + (cond ((and this-end end) + (goto-char this-end)) + (this-end + (goto-char this-end) + (setq end (match-beginning 0))) + (t + (setq end nil))))) + ;; We've moved past all Eshell-specific output redirections + ;; we could find. If there is only whitespace left, then + ;; `end' is right before redirections we should exclude; + ;; otherwise, we must include everything. + (unless (and end (skip-syntax-forward "\s" next-unmarked) + (= next-unmarked (point))) + (setq end next-unmarked)) + (let ((cmd (string-trim + (buffer-substring-no-properties beg end)))) + (goto-char end) + ;; We must now drop the asterisks, unless quoted/escaped. + (with-temp-buffer + (insert cmd) + (goto-char (point-min)) + (cl-loop + for next = (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*[|<>]\\)" t) + while next do (forward-char -2) (delete-char 1)) + (eshell-finish-arg + `(eshell-external-pipeline ,(buffer-string)))))))))) + +(defun eshell-rewrite-external-pipeline (terms) + "Rewrite an external pipeline in TERMS as parsed by +`eshell-parse-external-pipeline', which see." + (while terms + (when (and (listp (car terms)) + (eq (caar terms) 'eshell-external-pipeline)) + (with-connection-local-variables + (setcdr terms (cl-list* + shell-command-switch (cadar terms) (cdr terms))) + (setcar terms shell-file-name))) + (setq terms (cdr terms)))) + +(defsubst eshell-external-pipeline (&rest _args) + "Stub to generate an error if a pipeline is not rewritten." + (error "Unhandled external pipeline in input text")) + +(provide 'em-extpipe) +;;; esh-extpipe.el ends here diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index ade151d7cd..14e91912d1 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -54,6 +54,7 @@ eshell-modules-list eshell-basic eshell-cmpl eshell-dirs + eshell-extpipe eshell-glob eshell-hist eshell-ls diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el new file mode 100644 index 0000000000..1283b6b361 --- /dev/null +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -0,0 +1,205 @@ +;;; em-extpipe-tests.el --- em-extpipe test suite -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + + +;;; Code: + +(require 'cl-lib) +(require 'ert) +(require 'ert-x) +(require 'em-extpipe) +(eval-and-compile + (load (expand-file-name "eshell-tests-helpers" + (file-name-directory (or load-file-name + default-directory))))) + +(defvar eshell-history-file-name) +(defvar eshell-test--max-subprocess-time) +(declare-function eshell-command-result-p "eshell-tests-helpers") + +(defmacro em-extpipe-tests--deftest (name input &rest body) + (declare (indent 2)) + `(ert-deftest ,name () + (cl-macrolet + ((should-parse (expected) + `(let ((shell-file-name "sh") + (shell-command-switch "-c")) + ;; Strip `eshell-trap-errors'. + (should (equal ,expected + (cadr (eshell-parse-command input)))))) + (with-substitute-for-temp (&rest body) + ;; Substitute name of an actual temporary file and/or + ;; buffer into `input'. The substitution logic is + ;; appropriate for only the use we put it to in this file. + `(ert-with-temp-file temp + (let ((temp-buffer (generate-new-buffer " *temp*" t))) + (unwind-protect + (let ((input + (replace-regexp-in-string + "temp\\([^>]\\|\\'\\)" temp + (string-replace "#" + (buffer-name temp-buffer) + input)))) + ,@body) + (when (buffer-name temp-buffer) + (kill-buffer temp-buffer)))))) + (temp-should-string= (expected) + `(string= ,expected (string-trim-right + (with-temp-buffer + (insert-file-contents temp) + (buffer-string))))) + (temp-buffer-should-string= (expected) + `(string= ,expected (string-trim-right + (with-current-buffer temp-buffer + (buffer-string)))))) + (skip-unless shell-file-name) + (skip-unless shell-command-switch) + (skip-unless (executable-find shell-file-name)) + (let ((input ,input)) + (with-temp-eshell ,@body))))) + +(em-extpipe-tests--deftest em-extpipe-test-1 + "echo \"bar\" *| rev >temp" + (skip-unless (executable-find "rev")) + (should-parse '(eshell-named-command + "sh" (list "-c" "echo \"bar\" | rev >temp"))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-2 + "echo \"bar\" | rev *>temp" + (skip-unless (executable-find "rev")) + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "echo" (list (eshell-escape-arg "bar"))) + (eshell-named-command "sh" (list "-c" "rev >temp"))))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-3 "foo *| bar | baz -d" + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "sh" (list "-c" "foo | bar")) + (eshell-named-command "baz" (list "-d")))))) + +(em-extpipe-tests--deftest em-extpipe-test-4 + "echo \"bar\" *| rev >#" + (skip-unless (executable-find "rev")) + (should-parse + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "temp"))) + (eshell-named-command "sh" + (list "-c" "echo \"bar\" | rev")))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-buffer-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-5 + "foo *| bar ># baz" + (should-parse '(eshell-named-command + "sh" (list "-c" "foo | bar ># baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-6 + "foo ># *| bar baz" + (should-parse '(eshell-named-command + "sh" (list "-c" "foo ># | bar baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-7 + "foo *| bar ># >>#" + (should-parse + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "quux"))) + (ignore + (eshell-set-output-handle 1 'append + (get-process "other"))) + (eshell-named-command "sh" + (list "-c" "foo | bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-8 + "foo *| bar >/dev/kill | baz" + (should-parse + '(eshell-execute-pipeline + '((progn + (ignore + (eshell-set-output-handle 1 'overwrite "/dev/kill")) + (eshell-named-command "sh" + (list "-c" "foo | bar"))) + (eshell-named-command "baz"))))) + +(em-extpipe-tests--deftest em-extpipe-test-9 "foo \\*| bar" + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "foo" + (list (eshell-escape-arg "*"))) + (eshell-named-command "bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-10 "foo \"*|\" *>bar" + (should-parse + '(eshell-named-command "sh" (list "-c" "foo \"*|\" >bar")))) + +(em-extpipe-tests--deftest em-extpipe-test-11 "foo '*|' bar" + (should-parse '(eshell-named-command + "foo" (list (eshell-escape-arg "*|") "bar")))) + +(em-extpipe-tests--deftest em-extpipe-test-12 ">foo bar *| baz" + (should-parse + '(eshell-named-command "sh" (list "-c" ">foo bar | baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-13 "foo*|bar" + (should-parse '(eshell-execute-pipeline + '((eshell-named-command (concat "foo" "*")) + (eshell-named-command "bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-14 "tac *) id 1nC6Cq-0004Ep-4l for submit@debbugs.gnu.org; Mon, 24 Jan 2022 15:44:53 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:49311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC6Cn-0004Eb-FK for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 15:44:50 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2522F3200E79; Mon, 24 Jan 2022 15:44:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 24 Jan 2022 15:44:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=teO62WAoYjp8HscqMMTCmHkKWac+m7 JKL2rw5oowaB8=; b=x6MkDIAnFJoU6zLzt9pAL5HAfoPD7a6NxDmGIA+EO4Bb38 YIgoMNzp/0MKGqWV9XFBxMAn4BmgqfY/cBdkzQQsvjlpS//Hpn5o4MeDaqqgI77p 56gu7jEvgqjXzeqAJwjMtmsbTjgWwinDOnPNvxQZrVTYV74sNsi+JooFWe1IpPbc ORYUdwKl4dHA8UcLtCaRerUJYwGK4eFN/3gHiMs+sp6YaiJtq9uuvypeoamH1xE0 28geUVNfCeCj4LhTaxQHJtcYrPYkNvJrxOjWbDkA2LwG8J35hwWQERs+yw1Oh8Fc HOw5Z2jGYMxWBe464StTUwWVGEXJpcGJpessAzRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=teO62WAoYjp8HscqM MTCmHkKWac+m7JKL2rw5oowaB8=; b=hNP/B65CTY/Dpo3cJUeSWSVj4SHVkFCo6 l5HXcg/IeeF2tfJ4/Xz3Y/2VzYNDG3KC/NlTdCkvkyYRSOHqnH9v5nSqDXbxk54e mN2b+Z2p0QfYTYhZbazsEQWBUwkHPIQP8iwQgf4lYnrApw1w09DgfQGEDkzBcky5 1QYneAARP+atvx+npMxBaC6I6jBkzgKxrN52bOo5RjZLRwzqFbUjAtekTj+8ZV2W hUu4Mb01UYIf9kd6dA1XoSLI47jTDVyrVWNEZfFuUZdTH+GVPePNtZUnOdTcpAZZ eMU0c0Z7bQB6HC9oCygtb76bT3gZ+D1WRCFN/tpi57JCC0fLjO0LQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdejgddtjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfetvdfg hfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jan 2022 15:44:41 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 5E30A7E556C; Mon, 24 Jan 2022 13:44:41 -0700 (MST) From: Sean Whitton To: Michael Albinus , Lars Ingebrigtsen Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87zgnkj2me.fsf@melete.silentflame.com> References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 24 Jan 2022 13:44:41 -0700 Message-ID: <87v8y8j22u.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Mon 24 Jan 2022 at 01:32PM -07, Sean Whitton wrote: > On Mon 24 Jan 2022 at 03:18PM +01, Michael Albinus wrote: > >>> --- /dev/null >>> +++ b/test/lisp/eshell/eshell-tests-helpers.el >>> @@ -0,0 +1,90 @@ >>> +(provide 'eshell-tests) >>> + >>> +;;; eshell-tests.el ends here >> >> This shall be eshell-tests-helpers in both cases. > > Likewise fixed in the attached. ... but in the wrong patch, sigh. Revision attached. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v6-0001-Move-Eshell-test-helpers-to-their-own-file.patch >From 8b91bb7988f3ae905474bd80960a4e42f85108ca Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Jan 2022 22:32:22 -0700 Subject: [PATCH v6 1/3] Move Eshell test helpers to their own file * test/lisp/eshell/eshell-tests.el: * test/lisp/eshell/eshell-tests-helpers.el: Move helpers to own file. --- test/lisp/eshell/eshell-tests-helpers.el | 90 ++++++++++++++++++++++++ test/lisp/eshell/eshell-tests.el | 61 +++------------- 2 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 test/lisp/eshell/eshell-tests-helpers.el diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el new file mode 100644 index 0000000000..0930f82284 --- /dev/null +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -0,0 +1,90 @@ +;;; eshell-tests-helpers.el --- Eshell test suite helpers -*- lexical-binding:t -*- + +;; Copyright (C) 1999-2022 Free Software Foundation, Inc. + +;; Author: John Wiegley + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Eshell test suite helpers. + +;;; Code: + +(require 'ert) +(require 'ert-x) +(require 'esh-mode) +(require 'eshell) + +(defvar eshell-test--max-subprocess-time 5 + "The maximum amount of time to wait for a subprocess to finish, in seconds. +See `eshell-wait-for-subprocess'.") + +(defmacro with-temp-eshell (&rest body) + "Evaluate BODY in a temporary Eshell buffer." + `(ert-with-temp-directory eshell-directory-name + (let* (;; We want no history file, so prevent Eshell from falling + ;; back on $HISTFILE. + (process-environment (cons "HISTFILE" process-environment)) + (eshell-history-file-name nil) + (eshell-buffer (eshell t))) + (unwind-protect + (with-current-buffer eshell-buffer + ,@body) + (let (kill-buffer-query-functions) + (kill-buffer eshell-buffer)))))) + +(defun eshell-wait-for-subprocess () + "Wait until there is no interactive subprocess running in Eshell. +If this takes longer than `eshell-test--max-subprocess-time', +raise an error." + (let ((start (current-time))) + (while (eshell-interactive-process) + (when (> (float-time (time-since start)) + eshell-test--max-subprocess-time) + (error "timed out waiting for subprocess")) + (sit-for 0.1)))) + +(defun eshell-insert-command (text &optional func) + "Insert a command at the end of the buffer." + (goto-char eshell-last-output-end) + (insert-and-inherit text) + (funcall (or func 'eshell-send-input))) + +(defun eshell-match-result (regexp) + "Check that text after `eshell-last-input-end' matches REGEXP." + (goto-char eshell-last-input-end) + (should (string-match-p regexp (buffer-substring-no-properties + (point) (point-max))))) + +(defun eshell-command-result-p (text regexp &optional func) + "Insert a command at the end of the buffer." + (eshell-insert-command text func) + (eshell-wait-for-subprocess) + (eshell-match-result regexp)) + +(defvar eshell-history-file-name) + +(defun eshell-test-command-result (command) + "Like `eshell-command-result', but not using HOME." + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + (eshell-command-result command)))) + +(provide 'eshell-tests-helpers) + +;;; eshell-tests-helpers.el ends here diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 1a7ab0ab06..6aeefdfde2 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -29,61 +29,16 @@ (require 'ert-x) (require 'esh-mode) (require 'eshell) - -(defvar eshell-test--max-subprocess-time 5 - "The maximum amount of time to wait for a subprocess to finish, in seconds. -See `eshell-wait-for-subprocess'.") - -(defmacro with-temp-eshell (&rest body) - "Evaluate BODY in a temporary Eshell buffer." - `(ert-with-temp-directory eshell-directory-name - (let* (;; We want no history file, so prevent Eshell from falling - ;; back on $HISTFILE. - (process-environment (cons "HISTFILE" process-environment)) - (eshell-history-file-name nil) - (eshell-buffer (eshell t))) - (unwind-protect - (with-current-buffer eshell-buffer - ,@body) - (let (kill-buffer-query-functions) - (kill-buffer eshell-buffer)))))) - -(defun eshell-wait-for-subprocess () - "Wait until there is no interactive subprocess running in Eshell. -If this takes longer than `eshell-test--max-subprocess-time', -raise an error." - (let ((start (current-time))) - (while (eshell-interactive-process) - (when (> (float-time (time-since start)) - eshell-test--max-subprocess-time) - (error "timed out waiting for subprocess")) - (sit-for 0.1)))) - -(defun eshell-insert-command (text &optional func) - "Insert a command at the end of the buffer." - (goto-char eshell-last-output-end) - (insert-and-inherit text) - (funcall (or func 'eshell-send-input))) - -(defun eshell-match-result (regexp) - "Check that text after `eshell-last-input-end' matches REGEXP." - (goto-char eshell-last-input-end) - (should (string-match-p regexp (buffer-substring-no-properties - (point) (point-max))))) - -(defun eshell-command-result-p (text regexp &optional func) - "Insert a command at the end of the buffer." - (eshell-insert-command text func) - (eshell-wait-for-subprocess) - (eshell-match-result regexp)) +(eval-and-compile + (load (expand-file-name "eshell-tests-helpers" + (file-name-directory (or load-file-name + default-directory))))) (defvar eshell-history-file-name) - -(defun eshell-test-command-result (command) - "Like `eshell-command-result', but not using HOME." - (ert-with-temp-directory eshell-directory-name - (let ((eshell-history-file-name nil)) - (eshell-command-result command)))) +(defvar eshell-test--max-subprocess-time) +(declare-function eshell-insert-command "eshell-tests-helpers") +(declare-function eshell-match-result "eshell-tests-helpers") +(declare-function eshell-command-result-p "eshell-tests-helpers") ;;; Tests: -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v6-0002-Rework-eshell-match-result-for-testing-asynchrono.patch >From 40566a5d0c0ef4d30961915bac7875d078adb58e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 22 Jan 2022 18:54:55 -0700 Subject: [PATCH v6 2/3] Rework eshell-match-result for testing asynchronous commands When using eshell-match-result via eshell-command-result-p to examine the output of asynchronous Eshell commands, a newly emitted prompt is included in the text against which the regexp is matched. This makes it awkward to match against the whole output; for example, to check whether it is empty. Rework the function to exclude the prompt. * test/lisp/eshell/eshell-tests-helpers.el (eshell-match-result): Exclude any newly emitted prompt from the text against which the regexp is matched. Additionally, the function no longer moves point. * test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Update and simplify test given how eshell-match-result no longer moves point. --- test/lisp/eshell/eshell-tests-helpers.el | 9 +++++---- test/lisp/eshell/eshell-tests.el | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el index 0930f82284..77f5313d57 100644 --- a/test/lisp/eshell/eshell-tests-helpers.el +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -66,10 +66,11 @@ eshell-insert-command (funcall (or func 'eshell-send-input))) (defun eshell-match-result (regexp) - "Check that text after `eshell-last-input-end' matches REGEXP." - (goto-char eshell-last-input-end) - (should (string-match-p regexp (buffer-substring-no-properties - (point) (point-max))))) + "Check that output of last command matches REGEXP." + (should + (string-match-p + regexp (buffer-substring-no-properties + (eshell-beginning-of-output) (eshell-end-of-output))))) (defun eshell-command-result-p (text regexp &optional func) "Insert a command at the end of the buffer." diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 6aeefdfde2..542815df80 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -232,9 +232,8 @@ eshell-test/flush-output (with-temp-eshell (eshell-insert-command "echo alpha") (eshell-kill-output) - (eshell-match-result (regexp-quote "*** output flushed ***\n")) - (should (forward-line)) - (should (= (point) eshell-last-output-start)))) + (eshell-match-result + (concat "^" (regexp-quote "*** output flushed ***\n") "$")))) (ert-deftest eshell-test/run-old-command () "Re-run an old command" -- 2.30.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v6-0003-Add-Eshell-syntax-to-more-easily-bypass-Eshell-s-.patch >From aa30bf4b8fd3b9792149d95c86a15ecf573b99e6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 Jan 2022 15:15:36 -0700 Subject: [PATCH v6 3/3] Add Eshell syntax to more easily bypass Eshell's own pipelining * etc/NEWS: * doc/misc/eshell.texi (Input/Output): Document the new syntax. * lisp/eshell/em-extpipe.el: New module (Bug#46351). * test/lisp/eshell/em-extpipe-tests.el: New tests. * lisp/eshell/esh-module.el (eshell-modules-list): Add `eshell-extpipe'. --- doc/misc/eshell.texi | 42 ++++++ etc/NEWS | 10 ++ lisp/eshell/em-extpipe.el | 183 +++++++++++++++++++++++ lisp/eshell/esh-module.el | 1 + test/lisp/eshell/em-extpipe-tests.el | 207 +++++++++++++++++++++++++++ 5 files changed, 443 insertions(+) create mode 100644 lisp/eshell/em-extpipe.el create mode 100644 test/lisp/eshell/em-extpipe-tests.el diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index df6e3b861e..261e88d00c 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1142,6 +1142,48 @@ Input/Output The output function is called once on each line of output until @code{nil} is passed, indicating end of output. +@section Running Shell Pipelines Natively +When constructing shell pipelines that will move a lot of data, it is +a good idea to bypass Eshell's own pipelining support and use the +operating system shell's instead. This is especially relevant when +executing commands on a remote machine using Eshell's Tramp +integration: using the remote shell's pipelining avoids copying the +data which will flow through the pipeline to local Emacs buffers and +then right back again. + +Eshell recognises a special syntax to make it easier to convert +pipelines so as to bypass Eshell's pipelining. Prefixing at least one +@code{|}, @code{<} or @code{>} with an asterisk marks a command as +intended for the operating system shell. To make it harder to invoke +this functionality accidentally, it is also required that the asterisk +be preceded by whitespace or located at the start of input. For +example, + +@example + cat *.ogg *| my-cool-decoder >file +@end example + +Executing this command will not copy all the data in the *.ogg files, +nor the decoded data, into Emacs buffers, as would normally happen. + +The command is interpreted as extending up to the next @code{|} +character which is not preceded by an unescaped asterisk following +whitespace, or the end of the input if there is no such character. +Thus, all @code{<} and @code{>} redirections occuring before the next +asterisk-unprefixed @code{|} are implicitly prefixed with (whitespace +and) asterisks. An exception is that Eshell-specific redirects right +at the end of the command are excluded. This allows input like this: + +@example + foo *| baz ># +@end example + +@noindent which is equivalent to input like this: + +@example + sh -c "foo | baz" ># +@end example + @node Extension modules @chapter Extension modules Eshell provides a facility for defining extension modules so that they diff --git a/etc/NEWS b/etc/NEWS index 5297db3e2d..68c0eba866 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -858,6 +858,16 @@ the Galeon web browser was released in September, 2008. *** New user option 'ruby-toggle-block-space-before-parameters'. +** Eshell + ++++ +*** New feature to easily bypass Eshell's own pipelining. +Prefixing '|', '<' or '>' with an asterisk, i.e. '*|', '*<' or '*>', +will cause the whole command to be passed to the operating system +shell. This is particularly useful to bypass Eshell's own pipelining +support for pipelines which will move a lot of data. See "Running +Shell Pipelines Natively" in the Eshell manual. + ** Miscellaneous --- diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el new file mode 100644 index 0000000000..57aeec38ff --- /dev/null +++ b/lisp/eshell/em-extpipe.el @@ -0,0 +1,183 @@ +;;; em-extpipe.el --- external shell pipelines -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; When constructing shell pipelines that will move a lot of data, it +;; is a good idea to bypass Eshell's own pipelining support and use +;; the operating system shell's instead. This module tries to make +;; that easy to do. + +;;; Code: + +(require 'cl-lib) +(require 'esh-arg) +(require 'esh-io) +(require 'esh-util) + +(eval-when-compile (require 'files-x)) + +;;; Functions: + +(defun eshell-extpipe-initialize () ;Called from `eshell-mode' via intern-soft! + "Initialize external pipelines support." + (when (boundp 'eshell-special-chars-outside-quoting) + (setq-local + eshell-special-chars-outside-quoting + (append eshell-special-chars-outside-quoting (list ?\*)))) + (add-hook 'eshell-parse-argument-hook + #'eshell-parse-external-pipeline -20 t) + (add-hook 'eshell-pre-rewrite-command-hook + #'eshell-rewrite-external-pipeline -20 t)) + +(defun eshell-parse-external-pipeline () + "Parse a pipeline intended for execution by the external shell. + +A sequence of arguments is rewritten to use the operating system +shell when it contains `*|', `*<' or `*>', where the asterisk is +preceded by whitespace or located at the start of input. + +The command extends to the next `|' character which is not +preceded by an unescaped asterisk following whitespace, or the +end of input, except that any Eshell-specific output redirections +occurring at the end are excluded. Any other `<' or `>' +appearing before the end of the command are treated as though +preceded by (whitespace and) an asterisk. + +For example, + + foo # + +is equivalent to + + sh -c \"foo # + +when `shell-file-name' is `sh' and `shell-command-switch' is +`-c', but in + + foo ># *| baz + +and + + foo *| baz ># --some-argument + +the Eshell-specific redirect will be passed on to the operating +system shell, probably leading to undesired results. + +This function must appear early in `eshell-parse-argument-hook' +to ensure that operating system shell syntax is not interpreted +as though it were Eshell syntax." + ;; Our goal is to wrap the external command to protect it from the + ;; other members of `eshell-parse-argument-hook'. We must avoid + ;; misinterpreting a quoted `*|', `*<' or `*>' as indicating an + ;; external pipeline, hence the structure of the loop in `findbeg1'. + (cl-flet + ((findbeg1 (pat &optional go (bound (point-max))) + (let* ((start (point)) + (result + (catch 'found + (while (> bound (point)) + (let* ((found + (save-excursion + (re-search-forward "['\"\\]" bound t))) + (next (or (and found (match-beginning 0)) + bound))) + (if (re-search-forward pat next t) + (throw 'found (match-beginning 1)) + (goto-char next) + (while (or (eshell-parse-backslash) + (eshell-parse-double-quote) + (eshell-parse-literal-quote))))))))) + (goto-char (if (and result go) (match-end 0) start)) + result))) + (unless (or eshell-current-argument eshell-current-quoted) + (let ((beg (point)) end + (next-marked (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*[|<>]\\)")) + (next-unmarked + (or (findbeg1 "\\(?:\\=\\|[^*]\\|\\S-\\*\\)\\(|\\)") + (point-max)))) + (when (and next-marked (> next-unmarked next-marked) + (or (> next-marked (point)) + (looking-back "\\`\\|\\s-" nil))) + ;; Skip to the final segment of the external pipeline. + (while (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*|\\)" t)) + ;; Find output redirections. + (while (findbeg1 + "\\([0-9]?>+&?[0-9]?\\s-*\\S-\\)" t next-unmarked) + ;; Is the output redirection Eshell-specific? We have our + ;; own logic, rather than calling `eshell-parse-argument', + ;; to avoid specifying here all the possible cars of + ;; parsed special references -- `get-buffer-create' etc. + (forward-char -1) + (let ((this-end + (save-match-data + (cond ((looking-at "#<") + (forward-char 1) + (1+ (eshell-find-delimiter ?\< ?\>))) + ((and (looking-at "/\\S-+") + (assoc (match-string 0) + eshell-virtual-targets)) + (match-end 0)))))) + (cond ((and this-end end) + (goto-char this-end)) + (this-end + (goto-char this-end) + (setq end (match-beginning 0))) + (t + (setq end nil))))) + ;; We've moved past all Eshell-specific output redirections + ;; we could find. If there is only whitespace left, then + ;; `end' is right before redirections we should exclude; + ;; otherwise, we must include everything. + (unless (and end (skip-syntax-forward "\s" next-unmarked) + (= next-unmarked (point))) + (setq end next-unmarked)) + (let ((cmd (string-trim + (buffer-substring-no-properties beg end)))) + (goto-char end) + ;; We must now drop the asterisks, unless quoted/escaped. + (with-temp-buffer + (insert cmd) + (goto-char (point-min)) + (cl-loop + for next = (findbeg1 "\\(?:\\=\\|\\s-\\)\\(\\*[|<>]\\)" t) + while next do (forward-char -2) (delete-char 1)) + (eshell-finish-arg + `(eshell-external-pipeline ,(buffer-string)))))))))) + +(defun eshell-rewrite-external-pipeline (terms) + "Rewrite an external pipeline in TERMS as parsed by +`eshell-parse-external-pipeline', which see." + (while terms + (when (and (listp (car terms)) + (eq (caar terms) 'eshell-external-pipeline)) + (with-connection-local-variables + (setcdr terms (cl-list* + shell-command-switch (cadar terms) (cdr terms))) + (setcar terms shell-file-name))) + (setq terms (cdr terms)))) + +(defsubst eshell-external-pipeline (&rest _args) + "Stub to generate an error if a pipeline is not rewritten." + (error "Unhandled external pipeline in input text")) + +(provide 'em-extpipe) +;;; esh-extpipe.el ends here diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index ade151d7cd..14e91912d1 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -54,6 +54,7 @@ eshell-modules-list eshell-basic eshell-cmpl eshell-dirs + eshell-extpipe eshell-glob eshell-hist eshell-ls diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el new file mode 100644 index 0000000000..8b69e0504d --- /dev/null +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -0,0 +1,207 @@ +;;; em-extpipe-tests.el --- em-extpipe test suite -*- lexical-binding:t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Sean Whitton + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + + +;;; Code: + +(require 'cl-lib) +(require 'ert) +(require 'ert-x) +(require 'em-extpipe) +(eval-and-compile + (load (expand-file-name "eshell-tests-helpers" + (file-name-directory (or load-file-name + default-directory))))) + +(defvar eshell-history-file-name) +(defvar eshell-test--max-subprocess-time) +(declare-function eshell-command-result-p "eshell-tests-helpers") + +(defmacro em-extpipe-tests--deftest (name input &rest body) + (declare (indent 2)) + `(ert-deftest ,name () + (cl-macrolet + ((should-parse (expected) + `(let ((shell-file-name "sh") + (shell-command-switch "-c")) + ;; Strip `eshell-trap-errors'. + (should (equal ,expected + (cadr (eshell-parse-command input)))))) + (with-substitute-for-temp (&rest body) + ;; Substitute name of an actual temporary file and/or + ;; buffer into `input'. The substitution logic is + ;; appropriate for only the use we put it to in this file. + `(ert-with-temp-file temp + (let ((temp-buffer (generate-new-buffer " *temp*" t))) + (unwind-protect + (let ((input + (replace-regexp-in-string + "temp\\([^>]\\|\\'\\)" temp + (string-replace "#" + (buffer-name temp-buffer) + input)))) + ,@body) + (when (buffer-name temp-buffer) + (kill-buffer temp-buffer)))))) + (temp-should-string= (expected) + `(string= ,expected (string-trim-right + (with-temp-buffer + (insert-file-contents temp) + (buffer-string))))) + (temp-buffer-should-string= (expected) + `(string= ,expected (string-trim-right + (with-current-buffer temp-buffer + (buffer-string)))))) + (skip-unless shell-file-name) + (skip-unless shell-command-switch) + (skip-unless (executable-find shell-file-name)) + (let ((input ,input)) + (with-temp-eshell ,@body))))) + +(em-extpipe-tests--deftest em-extpipe-test-1 + "echo \"bar\" *| rev >temp" + (skip-unless (executable-find "rev")) + (should-parse '(eshell-named-command + "sh" (list "-c" "echo \"bar\" | rev >temp"))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-2 + "echo \"bar\" | rev *>temp" + (skip-unless (executable-find "rev")) + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "echo" (list (eshell-escape-arg "bar"))) + (eshell-named-command "sh" (list "-c" "rev >temp"))))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-3 "foo *| bar | baz -d" + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "sh" (list "-c" "foo | bar")) + (eshell-named-command "baz" (list "-d")))))) + +(em-extpipe-tests--deftest em-extpipe-test-4 + "echo \"bar\" *| rev >#" + (skip-unless (executable-find "rev")) + (should-parse + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "temp"))) + (eshell-named-command "sh" + (list "-c" "echo \"bar\" | rev")))) + (with-substitute-for-temp + (eshell-command-result-p input "^$") + (temp-buffer-should-string= "rab"))) + +(em-extpipe-tests--deftest em-extpipe-test-5 + "foo *| bar ># baz" + (should-parse '(eshell-named-command + "sh" (list "-c" "foo | bar ># baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-6 + "foo ># *| bar baz" + (should-parse '(eshell-named-command + "sh" (list "-c" "foo ># | bar baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-7 + "foo *| bar ># >>#" + (should-parse + '(progn + (ignore + (eshell-set-output-handle 1 'overwrite + (get-buffer-create "quux"))) + (ignore + (eshell-set-output-handle 1 'append + (get-process "other"))) + (eshell-named-command "sh" + (list "-c" "foo | bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-8 + "foo *| bar >/dev/kill | baz" + (should-parse + '(eshell-execute-pipeline + '((progn + (ignore + (eshell-set-output-handle 1 'overwrite "/dev/kill")) + (eshell-named-command "sh" + (list "-c" "foo | bar"))) + (eshell-named-command "baz"))))) + +(em-extpipe-tests--deftest em-extpipe-test-9 "foo \\*| bar" + (should-parse + '(eshell-execute-pipeline + '((eshell-named-command "foo" + (list (eshell-escape-arg "*"))) + (eshell-named-command "bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-10 "foo \"*|\" *>bar" + (should-parse + '(eshell-named-command "sh" (list "-c" "foo \"*|\" >bar")))) + +(em-extpipe-tests--deftest em-extpipe-test-11 "foo '*|' bar" + (should-parse '(eshell-named-command + "foo" (list (eshell-escape-arg "*|") "bar")))) + +(em-extpipe-tests--deftest em-extpipe-test-12 ">foo bar *| baz" + (should-parse + '(eshell-named-command "sh" (list "-c" ">foo bar | baz")))) + +(em-extpipe-tests--deftest em-extpipe-test-13 "foo*|bar" + (should-parse '(eshell-execute-pipeline + '((eshell-named-command (concat "foo" "*")) + (eshell-named-command "bar"))))) + +(em-extpipe-tests--deftest em-extpipe-test-14 "tac *) id 1nC6Ea-0004ID-R3 for submit@debbugs.gnu.org; Mon, 24 Jan 2022 15:46:40 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC6EV-0004Hv-R4 for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 15:46:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Hzkz15vJRKHyT1JS1yc5iwvOiUX+fXWM5i0sa1nv69w=; b=KnQlUwQChj9ngivR8tu9M/oPhj lwkl2uViU6/72LCPzUj48LEm7ey+uR/eVZQ3ASYWrrt+iwv4ajXUPuNV8gDlJRw08YTNhr9lxBZtB j9OFcrt33VvrGoT5nT/QoSOnaGp1rvszOuXXM6kOlEuH8jUnFEvD3rfQpot+tw18ceZ8=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nC6EL-0003bf-Gk; Mon, 24 Jan 2022 21:46:28 +0100 From: Lars Ingebrigtsen To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEU4OC4uTa1Gb9Fh lujLRyKeqo4vaCj///9uDHuWAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YBGBQuDlOUK3gAAAG4SURB VDjLhZNBctswDEXhGUrrkHEPIMo5gMXJnnYgrzON5LXacXj/I/QDpGTVcqdY0OR/+gAIyUQl7EOQ fVF91zbNy5qSX+1ptzo0972JAK8BcRTHnRieQWgsdcHbki4ilWsVdJYcVnnCWrdnLMEjh4PDNh6h DgGrdu/BCpy3rvsLEA8n32mNrlmAP7DpR66+RH//CsfFsVdgPsLclc153cA8Vnzrs1xq4FLvAJ8V D+pAk06BFBRgmD9wYQ3SRK0H6ImwdBDh8bkGtjwoOENvQ+cbEgP0wMxEhs9t0LMnEQO65x+RqBrO vkQG6JArvEezP3mXJ0dWeej2yMPRqAPjhaPEIYN80He+JCWU7+/HFTDR/HwCInGk8xY0bFDitAVv uF80vAUHJJKbPwe8AEcJkb+2KDe5WhHSlOAIx1+veYgAF1HrOk1U0++JduEogHXEVItHU6X0naBF AeIQRuM4XnG4zeD6PSZx0UUdkj5H1NoA8guj6Wcw//fyAxigqD3HAkpxnSyyTTxw7mbuKt2iQbeG Py8PYCKGndikDSC5LtEjKMr0b1A/gvo5WIQtSP8DZeozoBXImz/YRtu218yXRAAAACV0RVh0ZGF0 ZTpjcmVhdGUAMjAyMi0wMS0yNFQyMDo0NjoxNCswMDowMJFvEI8AAAAldEVYdGRhdGU6bW9kaWZ5 ADIwMjItMDEtMjRUMjA6NDY6MTQrMDA6MDDgMqgzAAAAAElFTkSuQmCC X-Now-Playing: David Bowie's _Brilliant Adventure (4): Earthling_: "Little Wonder" Date: Mon, 24 Jan 2022 21:46:24 +0100 In-Reply-To: <87zgnkj2me.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 24 Jan 2022 13:32:57 -0700") Message-ID: <87fspc276n.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sean Whitton writes: > Likewise fixed in the attached. Thanks; pushed to Emacs 29. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > Likewise fixed in the attached. Thanks; pushed to Emacs 29. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 15:48:18 2022 Received: (at 46351) by debbugs.gnu.org; 24 Jan 2022 20:48:18 +0000 Received: from localhost ([127.0.0.1]:46033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC6GA-0004Mi-4u for submit@debbugs.gnu.org; Mon, 24 Jan 2022 15:48:18 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC6G7-0004MV-Tq for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 15:48:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GqhG1VPlPp/xH8HAhM1pqW6tOuSl0bt9U1c2TweP65E=; b=gaIoYA1nzkiYDLjDz28k32mR5d I2CWpvMvZ84P6fCmmwsd9X7WnUMk0ZGpR1MtNzMmLEaFnklax4p3cpD2CdqqAbTrftZ8WBHv/dNUd o/tKw3ab1PldA6zbU1Y2dudERBiZDRpbHbdD/tQsZQV6GcHv9A4IkQ/OoiI80kjXftSc=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nC6Fy-0003eV-BM; Mon, 24 Jan 2022 21:48:08 +0100 From: Lars Ingebrigtsen To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87v8y8j22u.fsf@melete.silentflame.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEU4OC4uTa1Gb9Fh lujLRyKeqo4vaCj///9uDHuWAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YBGBQuDlOUK3gAAAG4SURB VDjLhZNBctswDEXhGUrrkHEPIMo5gMXJnnYgrzON5LXacXj/I/QDpGTVcqdY0OR/+gAIyUQl7EOQ fVF91zbNy5qSX+1ptzo0972JAK8BcRTHnRieQWgsdcHbki4ilWsVdJYcVnnCWrdnLMEjh4PDNh6h DgGrdu/BCpy3rvsLEA8n32mNrlmAP7DpR66+RH//CsfFsVdgPsLclc153cA8Vnzrs1xq4FLvAJ8V D+pAk06BFBRgmD9wYQ3SRK0H6ImwdBDh8bkGtjwoOENvQ+cbEgP0wMxEhs9t0LMnEQO65x+RqBrO vkQG6JArvEezP3mXJ0dWeej2yMPRqAPjhaPEIYN80He+JCWU7+/HFTDR/HwCInGk8xY0bFDitAVv uF80vAUHJJKbPwe8AEcJkb+2KDe5WhHSlOAIx1+veYgAF1HrOk1U0++JduEogHXEVItHU6X0naBF AeIQRuM4XnG4zeD6PSZx0UUdkj5H1NoA8guj6Wcw//fyAxigqD3HAkpxnSyyTTxw7mbuKt2iQbeG Py8PYCKGndikDSC5LtEjKMr0b1A/gvo5WIQtSP8DZeozoBXImz/YRtu218yXRAAAACV0RVh0ZGF0 ZTpjcmVhdGUAMjAyMi0wMS0yNFQyMDo0NjoxNCswMDowMJFvEI8AAAAldEVYdGRhdGU6bW9kaWZ5 ADIwMjItMDEtMjRUMjA6NDY6MTQrMDA6MDDgMqgzAAAAAElFTkSuQmCC X-Now-Playing: David Bowie's _Brilliant Adventure (4): Earthling_: "Little Wonder" Date: Mon, 24 Jan 2022 21:48:05 +0100 In-Reply-To: <87v8y8j22u.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 24 Jan 2022 13:44:41 -0700") Message-ID: <87bl00273u.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sean Whitton writes: > ... but in the wrong patch, sigh. Revision attached. Oops; the old one is already pushed. Can you supply an additional patch for this? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > ... but in the wrong patch, sigh. Revision attached. Oops; the old one is already pushed. Can you supply an additional patch for this? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 15:49:19 2022 Received: (at control) by debbugs.gnu.org; 24 Jan 2022 20:49:19 +0000 Received: from localhost ([127.0.0.1]:46037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC6H9-0004OR-Ds for submit@debbugs.gnu.org; Mon, 24 Jan 2022 15:49:19 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC6H7-0004OF-Ku for control@debbugs.gnu.org; Mon, 24 Jan 2022 15:49:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KAcC9s6yqQ9V96aClkvUmh2PzRTE6Y1u4fciRhvkdDM=; b=qd0Rl6CI9xNxNecVCwHrZHiLGq ZY46EyQco4n78g75cBDMx/Crxa29fPmhp9j+jdjFHjjPeSvmY8a0TrNgKmFubRBm7WUm8LPv0hKKW UHYBuyj8xPO9O5uqpCsQxZFTjqfOkFESku7X3ZHgqffOM4xjPwEZW0rXHmP3w3FuNsTk=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nC6Gz-0003ev-Mk for control@debbugs.gnu.org; Mon, 24 Jan 2022 21:49:11 +0100 Date: Mon, 24 Jan 2022 21:49:09 +0100 Message-Id: <87a6fk2722.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #46351 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 46351 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 46351 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 16:42:29 2022 Received: (at 46351) by debbugs.gnu.org; 24 Jan 2022 21:42:29 +0000 Received: from localhost ([127.0.0.1]:46085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC76b-0007vv-2R for submit@debbugs.gnu.org; Mon, 24 Jan 2022 16:42:29 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:40409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC76Y-0007vi-M3 for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 16:42:27 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 93D383200DA8; Mon, 24 Jan 2022 16:42:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 24 Jan 2022 16:42:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=QBuAOe18c7EKIgJjHukJLBBf+S9/7I snmTcM0YSW9w4=; b=nKy2sUjhhRdQq5YNAS/VWDGhLND0XvnEAvpLiRzCdFDde/ hBYgc7lSPNJ9V54VTSFDR03fwBQQhuh3GsKjnOfa3arcVBA0OOF/Zi41ZpC26phG JP4URr2BIDcgzO2kmofwnllVhMBhBquQQBFwtljRnxOhdviKGiTpJ9ccM8Xt9ri5 USUAw2vqz/B0ceZ80xl4IQRYwX6UKAxHTkiYpbxCNgez+PRmOFmMlFSCgFn95qjk 7oqajud0sp4YIdM2bTijFRGJ+tNloVffKQqc8l5el5NVjtg5/hxL+kJIWGDT9hSJ e/xDX2kL/M+i6dxU8lyZvW7qwb/vs31zUBq2Ec7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=QBuAOe18c7EKIgJjH ukJLBBf+S9/7IsnmTcM0YSW9w4=; b=kzchUUl1qg3sgcJdgH68pufUE0JtjbYxN WFJK06vP/YcQFj//u9hbR+TwW7EIGDwg3xcdXWtCNstXMl9VgolGP3t8H3hNBFTu 8qLLbXeUx5Z9lmmW7mjbMtrJWSgWhTXWFxmyIf6XEf6vG/keQE7fShgGJA7rAxpi 6DtZEaUI28eapIbrNXpXOqvs4PRqib0k7/ejdWy2l6eWh3tszlQycphj+A81rUBh Trl/ipikFsEP6PdOXnq2kyCbiDtoIdKA/Yg6m8AS8S6+hrHMHzGc24wSvbQifJ5V D8IsTRZRSsVw8n7hGrnFb44zdKB1guVXBgK/yYax3yOQTcwdQiTkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdejgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfetvdfg hfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jan 2022 16:42:19 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 8546C7E556D; Mon, 24 Jan 2022 14:42:18 -0700 (MST) From: Sean Whitton To: Lars Ingebrigtsen Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <87bl00273u.fsf@gnus.org> References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87v8y8j22u.fsf@melete.silentflame.com> <87bl00273u.fsf@gnus.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 24 Jan 2022 14:42:18 -0700 Message-ID: <87sftcizet.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hello, On Mon 24 Jan 2022 at 09:48PM +01, Lars Ingebrigtsen wrote: > Sean Whitton writes: > >> ... but in the wrong patch, sigh. Revision attached. > > Oops; the old one is already pushed. Can you supply an additional patch > for this? I put the "... ends here" fix into 667e212048 rather than 1693423fd7 which is not now fixable. However, I also noticed that em-extpipe-tests.el lacks a `provide' form so here is a fix for that. Pretty sure that's it for now. Thank you for reviewing and applying! -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-missing-provide-in-recently-introduced-em-extpip.patch >From 67017d9f13ce6f4c2ae6106b84db8d883b8ed551 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 24 Jan 2022 14:40:51 -0700 Subject: [PATCH] ; Fix missing `provide' in recently introduced em-extpipe-tests.el --- test/lisp/eshell/em-extpipe-tests.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el index 1283b6b361..8b69e0504d 100644 --- a/test/lisp/eshell/em-extpipe-tests.el +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -202,4 +202,6 @@ em-extpipe-test-16 (eshell-command-result-p input "rab") (eshell-command-result-p "echo \"bar\" | rev" "nonsense")))) +(provide 'em-extpipe-tests) + ;;; em-extpipe-tests.el ends here -- 2.30.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 16:51:16 2022 Received: (at 46351) by debbugs.gnu.org; 24 Jan 2022 21:51:16 +0000 Received: from localhost ([127.0.0.1]:46097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC7F6-0008Bh-4I for submit@debbugs.gnu.org; Mon, 24 Jan 2022 16:51:16 -0500 Received: from quimby.gnus.org ([95.216.78.240]:56282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC7F2-0008BP-Ia for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 16:51:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jZloRbTWDqrKb379H61XXNCYAS8kvxU5nyFJDkXBaA8=; b=F7VSMoqC4FHV0yYm4FBJYbXRG4 0/atJv+eL9KtndWMf5nbrGc3/EkJppRGblh0+EV1lAk1Y75Y39/jFTZMOVwTASeGrvEps3JIDPdNk HhsPU/L7RDvhbU6PMRCCbXzDRe2UEeNT57MMBuPjGv5gpcxeA7kvMAezRLTF3U1TFPRk=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nC7Es-00047l-2s; Mon, 24 Jan 2022 22:51:04 +0100 From: Lars Ingebrigtsen To: Sean Whitton Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87v8y8j22u.fsf@melete.silentflame.com> <87bl00273u.fsf@gnus.org> <87sftcizet.fsf@melete.silentflame.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEVgYoywwulqoN3/ //8CLQoHAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YBGBUyDS0oTagAAAFmSURBVCjPVdHPSiNBEAbw L4NZnJxmwbkH2RXxKbIH73GZr8n0SQKBpJ8iCAM695ZdT0GMpOspreqJQecwza+ruqr/oJqN/gAX nFeoUc3Gt0DDxhASmeg5ByJEBjQkDU5sxpCE3lDV9U+NRB8pmnZHOGGgrhnSeJjsCmnJPVFyd46H 1+Dj3iI7YHmQI9ZTXErvZQDOFPIJjTycUL2k5ZC2uZ/CK/6vMlC2KfjnHDmUtU+hdYrXcD3ex7T+ p5vFNEjXMYSDPBFIfUc7xXtveBzrhhVPJ4T+V2d4M/j+SgtQq/GWPjwnBRfjZkSft6MoZyO2QfYR XCxKFGy9NeX2GtAIva5JehzFhm3S6+Vkq7fS0W8MP2aInGivqKObF21Tk06r0TUFl8wR+99rwxP+ 2mU7vWu63+YB0UWDSzpA51cZ9iQ6EfLjbBRaZzvJWmXsitURYg+U22gaIEB9Ao7wccCNvH+Ffd/x Afkuz5cnpBFyAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTAxLTI0VDIxOjUwOjEzKzAwOjAwRc5Y AwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wMS0yNFQyMTo1MDoxMyswMDowMDST4L8AAAAASUVO RK5CYII= X-Now-Playing: David Bowie's _Brilliant Adventure (5): Hours_: "If I'm Dreaming My Life" Date: Mon, 24 Jan 2022 22:51:01 +0100 In-Reply-To: <87sftcizet.fsf@melete.silentflame.com> (Sean Whitton's message of "Mon, 24 Jan 2022 14:42:18 -0700") Message-ID: <875yq8246y.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sean Whitton writes: > I put the "... ends here" fix into 667e212048 rather than 1693423fd7 > which is not now fixable. However, I also noticed that > em-extpipe-tests.el lacks a `provide' form so here is a fix for that. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > I put the "... ends here" fix into 667e212048 rather than 1693423fd7 > which is not now fixable. However, I also noticed that > em-extpipe-tests.el lacks a `provide' form so here is a fix for that. > Pretty sure that's it for now. Thank you for reviewing and applying! We don't usually add provides in the test files, so that doesn't seem necessary. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 17:48:53 2022 Received: (at 46351) by debbugs.gnu.org; 24 Jan 2022 22:48:53 +0000 Received: from localhost ([127.0.0.1]:46186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC88r-0001K9-BC for submit@debbugs.gnu.org; Mon, 24 Jan 2022 17:48:53 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:42119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC88o-0001Jv-VB for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 17:48:52 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id A00673200D53; Mon, 24 Jan 2022 17:48:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 24 Jan 2022 17:48:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc: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=fm2; bh=InZGvtl7x30U8NLPLGk9hnXmyWAf8U 8h+90h7p1L8ws=; b=z6KuAUS9QViEXbNL5KqsULOL4a5RW8Bz+4MtFF58xWdCbM XKDeTv+tOFrEgm/6+7LpjwEX9PxnY7UQEoR8TBFHlBpEwjxKdCeIAVEuwAVSUwQA bO62r/MbIMjZhbMIIxy9rX0FGsQfwpARwODwzcdcwf2XXwuvk9eFird/CGPuwabv sS8WtIDjEjoPSbnTYvV11SVDgK2Wzf9VSgbbh4nC6wGZrOatFudbpYmu/BKW3jhV ZCjToFcIRBKBkYARZPmfc7OYz+p1D3GU7LZN/AzJoJhG5XGxn1bmSOdCy3a3wC4q aSOLcagIESq5i5EEl0sePJEOTGHfhyUmK+euyEDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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; bh=InZGvtl7x30U8NLPL Gk9hnXmyWAf8U8h+90h7p1L8ws=; b=PQNaQpgXTp6EU5JEDXkaV+IowEcnK+hzO tvDRxTxpRqBUPH5+HyUzz2cIA6SEtI8EKlgh5Q8RwYPcBBWsqWrWGhrUmOvZ1a2U 9BHrVtyVcZ+ws5HjcBkXHnWKGxi77SPsrMfuTvqwC7kkuDPOy2xaPYVvOkmjQTyu cqvNgE85XoRvrxNXsYr858/0qfI6uXIhJOLrSLFuys4SaImKpH0KfsfXfUgU0fI1 2u7gjWSx1l6cpICcjgjY44Oi7F2tAnE3LCSn9KjvTOHoTTy85mC4Y5lWn2I+L8NS /qZQwbOXNBDucgGnrEeGyXb2vUJ9dRvNVqpEt6Fm7nmxLDZV9iWgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdekgddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedugeeg feetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jan 2022 17:48:43 -0500 (EST) Received: by melete.silentflame.com (Postfix, from userid 1000) id 491557E55F5; Mon, 24 Jan 2022 15:48:43 -0700 (MST) From: Sean Whitton To: Lars Ingebrigtsen Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining In-Reply-To: <875yq8246y.fsf@gnus.org> References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87v8y8j22u.fsf@melete.silentflame.com> <87bl00273u.fsf@gnus.org> <87sftcizet.fsf@melete.silentflame.com> <875yq8246y.fsf@gnus.org> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Mon, 24 Jan 2022 15:48:42 -0700 Message-ID: <87czkgvjg5.fsf@melete.silentflame.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, On Mon 24 Jan 2022 at 10:51PM +01, Lars Ingebrigtsen wrote: > Sean Whitton writes: > >> I put the "... ends here" fix into 667e212048 rather than 1693423fd7 >> which is not now fixable. However, I also noticed that >> em-extpipe-tests.el lacks a `provide' form so here is a fix for that. >> Pretty sure that's it for now. Thank you for reviewing and applying! > > We don't usually add provides in the test files, so that doesn't seem > necessary. That makes more sense to me, I just saw it in eshell-tests.el today. Thanks again. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 21:39:24 2022 Received: (at 46351) by debbugs.gnu.org; 25 Jan 2022 02:39:24 +0000 Received: from localhost ([127.0.0.1]:46452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCBjv-0007LB-PC for submit@debbugs.gnu.org; Mon, 24 Jan 2022 21:39:23 -0500 Received: from mail-pg1-f174.google.com ([209.85.215.174]:37500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCBjt-0007Kx-W3 for 46351@debbugs.gnu.org; Mon, 24 Jan 2022 21:39:22 -0500 Received: by mail-pg1-f174.google.com with SMTP id e16so7791308pgn.4 for <46351@debbugs.gnu.org>; Mon, 24 Jan 2022 18:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MGUTUIOFkaJGHORQ4yH+vPr3f+ojEerB2uxYXAC6RWI=; b=ZjQE2hzfWykGO4OWG6mbcQymj8t7MSik0I0ZXHkfFQe7XK2cT5qts+ABHQh/PY7dqF bKlqi6yWx9zpWUEhvTYHwGM/6g42LaC16tBA8myt4FT3c/fL2lyQyPnweNgib7n3IeMi YyD/ik717EDqjaGBCEBZVuMLUioXMGD20XqPxQ04lKOvBSLBUS9GIHs9cGvIq/tP+YPg Y60evNpbRvTaZDDp6sjqrd/Q8QdHbZKuGjGGjxBbRkf//UXGxVElraBoR9KyE0I/DizM 3s2oKO7cf2bFHfBvBU09cshHhcuCuQiP4HaZz3kxYReYtA3vRYxNZGCLvd6+6H1ckVpg kS/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MGUTUIOFkaJGHORQ4yH+vPr3f+ojEerB2uxYXAC6RWI=; b=FZjuFajg2Tg0bkhepxis+oo4Db7odu3OgwQ6A3YpSjTjB0/G7WAvh6fAVqZXj5tn18 3laht6NOU4PIeGlQcoYFJQcBFJPQ5pkKfT9DJpi70f4eTxUntcBpVuJjV/u+CT79RuFh +FlcUwc5wCxvLdbacL+51pCj8jFm+9YosWvTiBS+EUSAbQP7Ss8D6HZY208+QoYFyMxd Cd6lIanXsIDerm8f71Om/HgWBHdoKzfMayod6HrL6QDewAkkgepm74eY1qkxNhdnln4V KO36pUs7idlhj+1J6jDYr/cQ/sookP3YGZwdAo5mrcGgn3wEOiWosNiRBj2QIorTtQww Fh1A== X-Gm-Message-State: AOAM530SLLeYM07+Z6VN6dzxFDAvOqkqshyu3YNn+5go2PgtGEY9u9nJ aoWTn7nCHWAVR29igmydVJg= X-Google-Smtp-Source: ABdhPJwHr4hMNX0g6W7tPbTUxdf1yLTERf4KwVsBq+Uw/9v36zozMn21lpXxPUmHhzKDmUAUo1LtbQ== X-Received: by 2002:a65:6a97:: with SMTP id q23mr14077442pgu.464.1643078356134; Mon, 24 Jan 2022 18:39:16 -0800 (PST) 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 r11sm18015097pff.81.2022.01.24.18.39.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jan 2022 18:39:15 -0800 (PST) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining To: Lars Ingebrigtsen , Sean Whitton References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87fspc276n.fsf@gnus.org> From: Jim Porter Message-ID: <639b931e-7816-ef07-510c-71178ff19fff@gmail.com> Date: Mon, 24 Jan 2022 18:39:15 -0800 MIME-Version: 1.0 In-Reply-To: <87fspc276n.fsf@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Robert Pluim , Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 1/24/2022 12:46 PM, Lars Ingebrigtsen wrote: > Sean Whitton writes: > >> Likewise fixed in the attached. > > Thanks; pushed to Emacs 29. I just noticed a small bit of breakage with this. It's no longer possible to refer to Lisp functions in Eshell like so: #'upcase Eshell explicitly supports this construct (see `eshell-lisp-regexp'), though it doesn't appear to be documented in the manual. Currently, this syntax is only occasionally useful, but I'm working on a patch series where it'll likely become a lot more common. My patches will add support for piping to Lisp functions, so that you can do the following, for example: $ echo hi | #'upcase HI It looks like the breakage in parsing #'upcase is the result of `eshell-parse-external-pipeline' trying to skip over args like '*|' (with the quotes). However, it sees the single-quote in #'upcase and then calls `eshell-parse-literal-quote', resulting in the error message: Expecting completion of delimiter ' ... From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 25 03:54:32 2022 Received: (at 46351) by debbugs.gnu.org; 25 Jan 2022 08:54:32 +0000 Received: from localhost ([127.0.0.1]:46843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCHay-0007G4-KK for submit@debbugs.gnu.org; Tue, 25 Jan 2022 03:54:32 -0500 Received: from mout.gmx.net ([212.227.17.20]:52801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCHaw-0007Fq-2r for 46351@debbugs.gnu.org; Tue, 25 Jan 2022 03:54:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1643100859; bh=v+FpV6o27Y2Abya2uj543rb/BoKy0TRwEXiCJQ+hTew=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=lwt9d8grSTuxkmc0EuNfz4cA0SUeClXMxGOln3aj2ARKL3IK9GmhZ2464Xt7N9mz5 bN730spZUMJtcPtmu2puTkBvdGnDrBMAMWx8zE/bHIsdreD1rgcV2/QRJI8E6Vfk81 LYNLuZgAZGhEzCXzQhKRUqGh9XTVcbl7XMsLU2pk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gandalf.gmx.de ([79.140.118.216]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJmGP-1msGpe279F-00KAVj; Tue, 25 Jan 2022 09:54:19 +0100 From: Michael Albinus To: Jim Porter Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87fspc276n.fsf@gnus.org> <639b931e-7816-ef07-510c-71178ff19fff@gmail.com> Date: Tue, 25 Jan 2022 09:54:18 +0100 In-Reply-To: <639b931e-7816-ef07-510c-71178ff19fff@gmail.com> (Jim Porter's message of "Mon, 24 Jan 2022 18:39:15 -0800") Message-ID: <87wnioqjph.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:TeT7doLYsFY9XDi1OZdZSCLttjaXtPwFh56iHqLqkwRnx5j4DHm 2APhbQRP9meFKNWo0g2B3XS30XcrXW5p2byFDzEOlhwikXiKKvEsqic6rPLc5h71SQkOqWs QPZgDSmignn4emAVVi8FpVv7ld1bIwxgrd7dUQf+nJ1o14HLm39b+coMVDCaUUnldReRhHv IHuGoAW1QlunTOLdONjKg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:WfhtgKxkdbM=:A3Uw0RIi+rsRut7v3+gKu6 oLinbjPdkXqVg24h+Ohj080w4ewNHBpoiYiCbYDHUlQ0xXZAb4UDJ8fV2pbTW28SgJf7D1Hvj BTf9J6k9BmS2uC1a1SvJQI3MLC50S4uM/EDD6+uCCUlomtjRogCTVh5Dm6p8ZTT8XTfcZp1sI Ap65+wFPsihAeLwy4fBQbg0lWGQZjDFBvdya/YNIs4LWMXslYga1tgXP9x9nMH0hjg9a5drhA 9Q+XWpdXSc9PAw5/bjIyNPr3uaQzMWe4L9PXvS60ZPPsyCWRtiw7laH7lK9y7wqBCpEWtzug7 dmn1vKdIexxfsYOg7OoVsVhbNDgHnaXChWoywGvtg3WJqJxy2MtOWJq6WAk6/YgRFQfTL/PVU eFnyV+LXae+Oh42/ZnsbQdiRnuD6utQjci6HQb80LJ+mqjhxFZ1bbfQicmCO8ZZ/jPpoHQsnP sJdfmE/BNnwQOBuisRcbtforIfFK0r3sxC/hhA4cUYgK3ttIAKW9zgBR+02PEC57weJdycJxL zuQKg6U3J87TDMpMVd5WVvjKvRYdtzpH6sdODm4N0TaeKhIKUU99ijtyTESHoaT7U+5xMjBre tGKIytb2mh5pWEMNyJANeqODoq5xoowg20yqpV3QMMGpNwfg0qnSLuD4AJaKqyl9j9EHA2p+w k/sDGVsOHaQpuZKMPxDL/PpbcRYTp6zba/eSP1ONwv32e3YO6BXCeURj9vKGVEzM8VW4WWvAt VeFf35V7BcQfLMrLivuO0lvgrnAGyVZBnnZP6dj74JtOra1kJ3OqCkF4aJmQu6eoi/oeNoZoG uiBvFgmBgTqVPKfh7H3boi77anr0WjhREsMTl3/hKJD01X3tnK613zgbTWKKjuGq15/JYmf+d MZ7Va+xFNUGRWmVeN7g0SyL9pKrmJJ+F+dyH/YQqRvnxEpTVfSxFTg72EDEwPEsS7FVfKH5Op 6nbONJDrxR2ERj1upIwObDNAvwVkFJIeXF7lEV1kRWDoJq4NE4PwHwMPwUyH0pHzwm6AlrpTQ i22ynliUZAL3wxDhkc2SnUiFuBX0C4+J7nefFHMcn7aXznXgSDSCJ+Mj5kElZJp2ScmgUjghP m/DIvcsbAZTFfI= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Lars Ingebrigtsen , Robert Pluim , Sean Whitton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Jim Porter writes: Hi Jim, > #'upcase > > Eshell explicitly supports this construct (see `eshell-lisp-regexp'), > though it doesn't appear to be documented in the manual. Shouldn't it? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 25 13:22:55 2022 Received: (at 46351) by debbugs.gnu.org; 25 Jan 2022 18:22:55 +0000 Received: from localhost ([127.0.0.1]:50045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCQT1-0005mX-GN for submit@debbugs.gnu.org; Tue, 25 Jan 2022 13:22:55 -0500 Received: from mail-pl1-f175.google.com ([209.85.214.175]:33764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCQSx-0005mH-2H for 46351@debbugs.gnu.org; Tue, 25 Jan 2022 13:22:54 -0500 Received: by mail-pl1-f175.google.com with SMTP id k17so2619045plk.0 for <46351@debbugs.gnu.org>; Tue, 25 Jan 2022 10:22:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=gvnn0Po8MVssIDNNqQTVJkM0bOiWM+WjQKq0DAh4deA=; b=LUNDG22ml1h0btVMLK2FJPjeoDsk8wehvFOZou4UlSijuRnKpSPRnNstFPWfuK0DYr 9LIqSfA8K9bWHU8zw9ugw59g4XH5NjjHJFnPTnMNb1DyI1j5C7Isw6tgS2MlwnGd6+NN 5/YNs2iyI6Qq8GAI3RcQdNEyLBdtIsUZSeulryn0xYlc3s+S917tUwm+xrjHbUWI6Cq4 1IzOFWo8A8hFpzIHjBTi3186apV8NzONiMRSlA7HM0PDTS9zbEbEkW1Wg/6xZdwO2oSL Z2qwKmAhmxUsd22CRo8/nyw6LpHtAZ2kKYo5Px5gcaZNtX3uCnV8UNwOWxujRnyJSb6A 2gjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gvnn0Po8MVssIDNNqQTVJkM0bOiWM+WjQKq0DAh4deA=; b=B9QKLVYB1uN+KlJckdS2IRPozp8qHjiIvGpUx63F9DA7jrFhr79OSEh4hgdoeF/dC1 Or257DiGrUPfgKyHQBsXYhtiKgpZIK0F6ZU992K+t2PjYaaS1izgQ90PM1Tk/XPgoniW mh6YOnIQJvYwRMGSSKUC3qjfkOcVSisBDOF9I4A5EYHPc85wm594wFY0JsYgp2adLcnF uchzUYbmkArqAk5Zw6N5F1NnzggJDmKavytcmwvDCRIcab898DcD/DqtnJX3A1u409FS 3QIf/w4qkzVStb7hxHNwK9jh7yEuFAqtS8Qdl3sLCKVxxXodAI8at2x52z5tOKZbIbOa KaDg== X-Gm-Message-State: AOAM533DkifyiK8GBr1eNedkNvLcWmqtA2EG3R6rwcQq4YDA6H6BrPVX 2BXVsbpc7tnKYp4weSnmxD4= X-Google-Smtp-Source: ABdhPJyK2h8HAWHtoBmqnSeZPKtvIMLnXTxMOt6ozDm3vhBkOMFrTyvTeGz6dV+UWnnWVqr/p+Cygg== X-Received: by 2002:a17:902:7148:b0:14b:650c:4ce7 with SMTP id u8-20020a170902714800b0014b650c4ce7mr6645539plm.4.1643134965340; Tue, 25 Jan 2022 10:22:45 -0800 (PST) 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 p21sm6665394pfh.89.2022.01.25.10.22.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jan 2022 10:22:45 -0800 (PST) Subject: Re: bug#46351: 28.0.50; Add convenient way to bypass Eshell's own pipelining To: Michael Albinus References: <8735lersah.fsf@melete.silentflame.com> <87pmohrzcj.fsf@gmx.de> <87zgnkj2me.fsf@melete.silentflame.com> <87fspc276n.fsf@gnus.org> <639b931e-7816-ef07-510c-71178ff19fff@gmail.com> <87wnioqjph.fsf@gmx.de> From: Jim Porter Message-ID: Date: Tue, 25 Jan 2022 10:22:46 -0800 MIME-Version: 1.0 In-Reply-To: <87wnioqjph.fsf@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46351 Cc: 46351@debbugs.gnu.org, Lars Ingebrigtsen , Robert Pluim , Sean Whitton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 1/25/2022 12:54 AM, Michael Albinus wrote: > Jim Porter writes: > > Hi Jim, > >> #'upcase >> >> Eshell explicitly supports this construct (see `eshell-lisp-regexp'), >> though it doesn't appear to be documented in the manual. > > Shouldn't it? Do you mean "shouldn't it be documented in the manual"? If so, I agree. I'll be sure to explain this in the manual alongside my patch to add support for piping to Lisp functions in Eshell. (It seems better to do it all at once since if I updated the manual now, I'd probably have to update those parts again to account for the pipeline changes.) From unknown Tue Jun 17 01:46:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Feb 2022 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator