help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find-function-source-directory


From: Eli Zaretskii
Subject: Re: find-function-source-directory
Date: Mon, 19 Feb 2018 17:36:31 +0200

> Date: Mon, 19 Feb 2018 12:44:20 +0100
> From: <tomas@tuxteam.de>
> 
> > > This notwithstanding, I think that doc string is misleading: what you
> > > want to accomplish isn't possible, because find-function-source-path
> > > cannot override load-path in this use case.  Or maybe I'm missing
> > > something.
> > 
> > Ah, thanks. (Sorry, I missed this message earlier.)
> > I'm wondering if there is there any use for
> > find-function-source-path, if not that. Perhaps it
> > is an ex-feature?
> 
> 
> Hm. Looking at the elisp sources, it seems to me that this variable
> is used (cf. find-library-name) in a way that corresponds with its
> docstring. An extract:

Yes, I've seen that as well.  But it turns out the code pulls a few
rabbits out of its hat before it even gets there: it uses load-history
and other related stuff, which gives absolute file names, so no need
to search any directories.

I propose to step in Edebug through the function and its subroutines,
and see what happens.  It looks like it uses different approaches for
preloaded symbols, autoloaded symbols, and the rest.  I didn't have
enough time to figure out all the details, but one thing that tripped
me was that, even if I start with a symbol that is neither preloaded
nor autoloaded, fairly soon it becomes boundp or fboundp, which means
Emacs loads its package, and at that time, there's no reason for Emacs
to do any path search.

If someone actually figures out what the code does, please tell the
details, as I'm quite sure we will have to update the doc string.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]