A couple of weeks ago, I wrote about piping Eshell output to a buffer. It’s a cute trick but it only works in Eshell. It turns out you can do better.
iLemming has a video on piping in and out of an Emacs buffer even in a normal shell. He begins by showing how to accomplish input redirection within Eshell. That’s not supported by Eshell itself so it requires a supporting eshell function—that iLemming calls b—to work.
The real juice of the video is making this work in a normal—that is, non-Eshell— shell. That requires another function, mxp, this time a shell script. If you watch the video or follow the mxp link, you’ll see several examples of mxp in use. It’s really quite flexible.
All of this clever and the code is worth taking a look at to see how you might do this type of thing. Still, I don’t see how I would use this capability. I could probably make up some fake application for it but it’s hard to imagine any realistic use. Of course, that’s probably due to my lack of imagination and I’m sure some of you will jump in to educate me.
Update : Ag Ibragimov notes in the comments that he’s moved the project because of a naming conflict. The new GitHub repository is here.