On Tue, May 28, 2024, 9:21 PM Dmitry Gutov <dmitry@gutov.dev> wrote:
> 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.

It would be doubly interesting if we manage to implement it so that
Tramp would be able to connect two processes directly without
round-tripping the i/o from the remote host to local and back to remote.
That's a major source of latency in project-find-regexp on remote.

Unfortunately this is almost impossibly hard.  But, I actually have worked extensively on doing this specific impossible thing (remote process APIs that are powerful enough to do this) so I will eventually try to implement them for Emacs and TRAMP.  It would allow full make-process support in TRAMP as well as a make-pipe-process which represents a pipe existing on a remote system.

Anyway, in the short term it will probably only work efficiently for local processes, with remote project-files having to roundtrip through the local Emacs.