all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: find-function-source-directory
Date: Mon, 19 Feb 2018 17:36:31 +0200	[thread overview]
Message-ID: <83a7w59ekg.fsf@gnu.org> (raw)
In-Reply-To: <20180219114420.GA16648@tuxteam.de> (tomas@tuxteam.de)

> 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	other threads:[~2018-02-19 15:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-18 16:16 find-function-source-directory Richard Copley
2018-02-18 18:40 ` find-function-source-directory Eli Zaretskii
2018-02-18 19:35   ` find-function-source-directory Eli Zaretskii
2018-02-19 11:13     ` find-function-source-directory Richard Copley
2018-02-19 11:44       ` find-function-source-directory tomas
2018-02-19 15:36         ` Eli Zaretskii [this message]
2018-02-19 15:43           ` find-function-source-directory tomas
2018-02-18 19:53   ` find-function-source-directory Drew Adams
2018-02-18 20:18     ` find-function-source-directory Eli Zaretskii
     [not found]   ` <<a8455f40-e18a-44ac-8523-435e84f2d2e8@default>
     [not found]     ` <<83h8qe9hld.fsf@gnu.org>
2018-02-18 21:56       ` find-function-source-directory Drew Adams
2018-02-19  3:24         ` find-function-source-directory Richard Copley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a7w59ekg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.