;;; Cool shell-like hacks to grab previous commands from input history. ;;; Inputs beginning with ! echo and execute the last matching command. ;;; If ` is pressed, it grabs the last matching command for editing. ;;; Kareila 02/03/1999 /def -p1000 -mregexp -h'SEND ^!(.*)$' resend = \ /let matchtxt=$(/recall -i /1 %P1*) %; \ /if (strlen(matchtxt)) \ /echo %% %matchtxt %; \ /if (regmatch('^/', matchtxt)) \ /eval %matchtxt %; \ /else \ /send %matchtxt %; \ /endif %; \ /else \ /beep 1 %; \ /endif /def -b'`' reedit = \ /if (regmatch('^!', (kbhead()))) \ /let matchtxt=$(/recall -i /1 $[substr((kbhead()),1)]*) %; \ /if (strlen(matchtxt)) \ /grab %matchtxt %; \ /else \ /beep 1 %; \ /endif %; \ /else \ /@test input("`") %; \ /endif