C-u M-| is wonderful for things like running sort
a region. But I've wandered into an interesting place. I wan to run join
or comm
on two regions in a buffer.
# region 1
a 1
b 2
z 26
# region 2
a foobar
b 2
c 3
and I want join -j1 <(region 1) <(region 2)
.
I think registers or secondary selection could make this easier than the albeit already quick
# select region 1
M-| cat > /tmp/r1
# select region 2
M-| cat > /tmp/r2
# position cursor below
M-| join -j1 /tmp/r[12]
I don't see anything about referencing registers or selections in shell-command-on-region
but maybe there is a similar command, universal argument, or package?
Would it be outrageous to point to files through /proc or a la elfuse
(Edit: example output -- current buffer)
# region 1
a 1
b 2
z 26
# region 2
a foobar
b 2
c 3
# join -j1 /tmp/r[12]
a 1 foobar
b 2 2
# comm -12 /tmp/r[12]
b 2
zones.el
might be able to help with the joining, depending on what you mean; dunno. – Drew Jun 12 '20 at 18:30#
comment lines to indicate what happened (as I do in my notes) – Will Jun 29 '20 at 18:01