if (word(2 $loadinfo()) != [pf]) { load -pf $word(1 $loadinfo()); return; };

on ?unknown_command "*" (cmd, args) {
  @ :bonly = 0;
  if (left(2 $cmd) == [//]) {
    @ :bonly = 1;
    @ :cmd = rest(2 $cmd);
  };
  @ :matches = symbolctl(pmatch builtin_command $cmd*);
  if (!bonly) {
    push matches $symbolctl(pmatch alias $cmd*);
  };
  @ :matches = uniq($matches);
  @ :num = #matches;
  if (num > 1) {
    xecho -b Ambiguous ${bonly ? [builtin ] : []}command $cmd. Matches \($num\): $unsplit(", " $leftw(5 $matches))${num > 5 ? [, ...] : []};
    return 1;
  };
  if (num == 1) {
    xeval -n {$matches $args};
    return 1;
  };
  return 0;
};
