From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: find-function-source-directory Date: Mon, 19 Feb 2018 17:36:31 +0200 Message-ID: <83a7w59ekg.fsf@gnu.org> References: <83tvue9m4t.fsf@gnu.org> <83mv069jlp.fsf@gnu.org> <20180219114420.GA16648@tuxteam.de> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1519054520 16611 195.159.176.226 (19 Feb 2018 15:35:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2018 15:35:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 19 16:35:16 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ennT9-0003PM-OC for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Feb 2018 16:35:07 +0100 Original-Received: from localhost ([::1]:50865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ennVC-0002Dx-1D for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Feb 2018 10:37:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ennUR-0002CI-FI for help-gnu-emacs@gnu.org; Mon, 19 Feb 2018 10:36:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ennUN-0002rZ-BX for help-gnu-emacs@gnu.org; Mon, 19 Feb 2018 10:36:27 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ennUN-0002rR-8G for help-gnu-emacs@gnu.org; Mon, 19 Feb 2018 10:36:23 -0500 Original-Received: from [176.228.60.248] (port=2351 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ennUM-0006OZ-No for help-gnu-emacs@gnu.org; Mon, 19 Feb 2018 10:36:23 -0500 In-reply-to: <20180219114420.GA16648@tuxteam.de> (tomas@tuxteam.de) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116048 Archived-At: > Date: Mon, 19 Feb 2018 12:44:20 +0100 > From: > > > > 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.