Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Suggestion: Allow whence to report path(s) for autoloaded functions
- X-seq: zsh-users 14056
- From: Ian Tegebo <ian.tegebo@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Suggestion: Allow whence to report path(s) for autoloaded functions
- Date: Tue, 21 Apr 2009 14:14:09 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=pNo3WfD8wMNWxlY46OU+Gi+0Y4sWxIuzRpbeTpSvucw=; b=skyiyhzqq51rtNF/F/XzpxiP/UM+Wio7blE5RkSxpLkCfQb5VlnzgmH7JsFrZgJCLL lRUGlCYn8xpZ2ggwvSg6B3VFOmu8+rflWhAyRTNdtVR+S6geYTtOkeizojma+t0WSqqW B/J5S0MCX344unxkSSYhd9gUzzXxEDZgpBypM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=KApOksLA1nq8BRM+R+7IuRsUpeUHOxUPb6wfZ4bf1sJqdCGjiOoGJBCn021WnOqMHy uxE9KWrWynqblQ4PdCE3f9Q95kY0TJgunDTK5jNIvhaLC69xvZzN2poBC61NeCQT7oZ7 AyW0cGa3kveJyAC8W5IYD5vTL+Du46VI2tRiI=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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