> well, though an inspiring idea, it doesn't sound to be much practical:
> 1) I usually have a special window in which I have many commands. I
> then select the one needed and chord it to the appropriate window
> (i.e. I don't use the whole contents of a window).
> 2) sometimes I have more such windows.

This is an interesting usage model.  I've never seen it before.
The power of acme is that you can extend it with external
programs.  The script below implements this usage; I called it Run.
You can type and select your command in one window, with a name matching
pattern, and then in the other window's tag execute >Run pattern.
Run finds the window with a title matching pattern, pulls out the
selected text, and runs it through rc.

See http://swtch.com/~rsc/acme-Run.png for an illustration.

Russ


#!/bin/rc

if(! ~ $#* 1) {
        echo 'usage: Run title' >[1=2]
        exit usage
}

id=`{awk -v 'pat='$1 '$6 ~ pat {print $1}' /mnt/wsys/index}
if(~ $#id 0) {
        echo 'no match for pattern' >[1=2]
        exit none
}
if(! ~ $#id 1) {
        echo 'ambiguous pattern' >[1=2]
        exit ambiguous
}
if(~ `{wc -w /mnt/wsys/$id/rdsel} 0) {
        echo 'no command selected' >[1=2]
        exit missing
}
exec rc /mnt/wsys/$id/rdsel

Reply via email to