On 2022-11-09 19:05:57 +0100 Antonio Diaz Diaz wrote:
┃ ┃ Adding an ex-like range to ! that sends the addressed lines to an
┃ ┃ external command and replaces them with its output.
┃
┃ I don't think there's any good way to do this now that doesn't involve
multiple
┃ steps and a temporary file.
┃
┃ For the time being I have documented in the manual the "multiple
steps" approach while
┃
┃ I can decide how to implement it (with fork like zutils, or old style
with a temporary file).
┃
┃ What do you think?
If you're okay with fork/exec, you should be able to pretty much cut
and paste the filter-lines function:
https://github.com/slewsys/ed/blob/b2e4681c3627f7b135cb4702c6071c628e5dcd6d/src/aux.c#L47
Here's where it's actually called:
https://github.com/slewsys/ed/blob/b2e4681c3627f7b135cb4702c6071c628e5dcd6d/src/exec.c#L1752
I'm not at liberty to make a formal patch at the moment, but the code
is free and clear to use.
-AM