Oops forgot a '
fn winclear {
echo -n Edit ,d > /dev/acme/body
echo -n /Edit, d/ > /dev/acme/addr
echo -n 'dot=addr' > /dev/acme/ctl
cat /dev/acme/addr | awk '{printf("MX%s %s\n", $1, $2)}' > /dev/acme/event
}
On 7/14/06, David Leimbach <[EMAIL PROTECTED]> wrote:
Of course you can just type "Edit ,d" and middle click it. But
sometimes you're just typing along and don't feel like grabbing the
mouse... or at least I do. I'm sure it's not particularly useful for
most of you guys who like everything the way it's always been, but I
learned something doing this so it was at least useful to me.
In my defense I did it without adding extra code, and even used the
features of win and the private namespaces to accomplish it this time.
fn winclear {
echo -n Edit ,d > /dev/acme/body
echo -n /Edit, d/ > /dev/acme/addr
echo -n 'dot=addr' > /dev/acme/ctl
cat /dev/acme/addr | awk '{printf("MX%s %s\n", $1, $2)} > /dev/acme/event
}
This basically does exactly what you do when you type "Edit ,d" and
middle click it.
I'm sure there's a much easier, cleaner way to do this, but I thought
it was an interesting exploration of the acme filesystem and the event
protocol.
Interestingly the format that is read out from /dev/acme/event is
actually not valid input for the same file. If you provide anything
but the first two offsets to a command, flags and such as write input
to /dev/acme/event, it's an error. I don't think the man page
explains this well, but I'm tired and may have missed that too.