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

Re: Is it possible to find the location of a function definition?



Thanks Mikael.

The first approach is very smart and solved the problem.






On Sun, Apr 5, 2015 at 9:57 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:

> On Mon, Apr 6, 2015 at 6:23 AM, Hao Wu <echowuhao@xxxxxxxxx> wrote:
> > Hi,
> >
> > Is it possible to find the location of a function definition without
> going
> > over all the files.?
> >
> > I get a function override the default one, which is quite annoying. I
> want
> > to find location of the definition.
> >
> >
> http://stackoverflow.com/questions/11627324/zsh-search-for-function-definition
>
> One way you could do it is look at the definition of the function,
> which thefunc, and override one of the commands it calls with a
> function that prints $funcfiletrace,
> echo() { builtin echo $funcfiletrace; builtin echo "$@" } (don't do
> this globally of course, just in an interactive shell)
> another way is to apply this patch:
>
> http://git.mikachu.zsh.jp/commit/?h=mika&id=225140c2aa029c9f19615c5894c4813a88afca49
> and then run whence -F thefunc
>
> --
> Mikael Magnusson
>


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