View Single Post
Old 02-15-2014, 02:55 PM   #28
signum
Zealot
signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.
 
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
As long as we're blue-skying here, I'd like to see a "pipe to" facility. It would work somewhat like the "open with" in the older, now abandoned editor (ONAE), but provide full-duplex I/O to any arbitrary executable you might like. The ONAE seemed to presume that just an editor was to be opened, all the input sent to it at once, the editor does its thing and then sends back all output at once. I couldn't get it to handle read-a-line, modify, write-a-line (RMW) interleaving. The more general pipe-to would allow you to write a batch (or shell) script to do most anything you want. With the RMW idea you could write a script to do most of what a plug-in would do and even more. The essential idea is that it turns search-replace on its head. With S/R, you apply one search pattern and one replace pattern to the entire file and then go on with the next S/R and start over with the top of the file. With the RMW idea, you apply all S/R patterns to a single line, write it out and then do the same thing to the next line. Everything is done in a single pass through the file. You should be able to pipe a set of html lines to the system sort program, for instance. Or pass a bunch of html through the C pre-processor or any other macro processor. Or copy the input to a disk file.

Another separate feature that would work well with this and the built-in S/R would be the ability to mark or highlight a set of code lines and restrict the S/R (or pipe-to) to just those lines. You wouldn't often want to sort an entire file of html code, but I often want to sort a list written in html.
signum is offline   Reply With Quote