zsh-users
 help / color / mirror / code / Atom feed
* Suggestion: Allow whence to report path(s) for autoloaded functions
@ 2009-04-21 21:14 Ian Tegebo
  2009-04-22  8:29 ` Peter Stephenson
  2009-04-25 19:55 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Ian Tegebo @ 2009-04-21 21:14 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-26  1:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-21 21:14 Suggestion: Allow whence to report path(s) for autoloaded functions Ian Tegebo
2009-04-22  8:29 ` Peter Stephenson
2009-04-25 19:55 ` Bart Schaefer
2009-04-26  1:38   ` Ian Tegebo

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).