emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Native OS pipelines in eshell and Emacs


From: Spencer Baugh
Subject: Native OS pipelines in eshell and Emacs
Date: Tue, 28 May 2024 10:42:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

eshell "pipelines" operate by reading the data in from one process and
writing it out to the next process.  Thus the data flows from one
process, to Emacs, and then to the next process.

This differs from the native OS capability to make a pipe and pass one
end down to one process as stdout, and the other end down to another
process as stdin, which is more efficient.

Has there been work before on supporting this in eshell and Emacs?

I saw there was the new em-extpipe capability in eshell, but that
requires different syntax bypasses Eshell's usual features - adding the
ability to create pipelines natively in Emacs would allow the normal
Eshell syntax to just be efficient on its own.  (This would, I think,
remove the need for extpipe)

This same ability would be useful for project.el, where it would be nice
for the output of project-files (e.g. "git ls-files") to be piped
directly to xargs grep for commands like project-find-regexp, instead of
sending the data through Emacs which makes it substantially slower.

Specifically, the new feature would be something like an :stdin argument
to make-process which allows a make-pipe-process (or other process) to
be passed as stdin, and grabs the output file descriptor from that
process (what Emacs would normally read) and passes it down as stdin for
the new process instead.

I'm working on a patch to do this, but I wonder if any work has been
done on this before?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]