Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Suggestion: Allow whence to report path(s) for autoloaded functions



Given a function name, I'm finding it useful to know where it's
located within fpath:

for p in $fpath; do
  [[ -e $p/_MYFUNC ]] && echo $p/_MYFUNC && break
done

(where fpath is something like ( /blah/path_one/  /blah/path_two/ ) )

It seems like 'whence -v _MYFUNC' is the intuitive place to look for
this behavior.  I'd imagine it working like:

$ whence -v _MYFUNC
_MYFUNC is a shell function defined in /blah/path/_MYFUNC

Consequently, removing the '&& break' provides the expected result for
'whence -a':

$ whence -av _MYFUNC
_MYFUNC is a shell function defined in /blah/path_one/_MYFUNC
_MYFUNC is a shell function defined in /blah/path_two/_MYFUNC

(BTW, is zsh-workers@ more appropriate for discussing changes to builtins?)
-- 
Ian Tegebo



Messages sorted by: Reverse Date, Date, Thread, Author