eshell-alternate-command-hook

eshell-alternate-command-hook is a variable defined in `esh-ext.el'.
Its value is
nil

  • This variable may be risky if used as a file-local variable.

Documentation:
A hook run whenever external command lookup fails.
If a functions wishes to provide an alternate command, they must throw
it using the tag `eshell-replace-command'. This is done because the
substituted command need not be external at all, and therefore must be
passed up to a higher level for re-evaluation.

Or, if the function returns a filename, that filename will be invoked
with the current command arguments rather than the command specified
by the user on the command line.

You can customize this variable.