alias -l process {
var %i = 1
while ($gettok(%ffe.types,%i,59)) {
if ($v1 iswm $1-) return
inc %i
}
inc %ffe.n
if (@* iswm %ffe.command) && ($window(%ffe.command)) aline -l $v1 $1-
elseif ($replace(%ffe.command,~file,$1-,~n,%ffe.n)) $v1
}
alias findfileexcept {
if (($0 == 3) && ($isdir($1)) && ($3 isnum)) || (($0 == 4) && ($isdir($1)) && ($3 isnum)) || (($0 == 5) && ($isdir($1)) && ($3 isnum) && ($4 isnum)) !
else return * Look up /help $!findfile to see the format for this identifier.
set -u %ffe.n 0
set -u %ffe.types $2
if (($0 == 4) && ($4 !isnum)) || ($0 == 5) set -u %ffe.command $iif($5,$5,$4)
noop $findfile($1,*,0,$iif($4 isnum,$4,999),process $1-)
return %ffe.n
}