From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6716: 23.2; Setting `find-function-source-path' has no effect. Date: Mon, 26 Jul 2010 01:45:13 +0200 Message-ID: References: <874ofpqeiu.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1280102868 32662 80.91.229.12 (26 Jul 2010 00:07:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 26 Jul 2010 00:07:48 +0000 (UTC) Cc: 6716@debbugs.gnu.org To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 26 02:07:45 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OdBEO-00053c-Pu for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jul 2010 02:07:45 +0200 Original-Received: from localhost ([127.0.0.1]:49358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdBEO-0005z4-5P for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Jul 2010 20:07:44 -0400 Original-Received: from [140.186.70.92] (port=55512 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdBEG-0005xb-DT for bug-gnu-emacs@gnu.org; Sun, 25 Jul 2010 20:07:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdBEE-0006ZY-Lq for bug-gnu-emacs@gnu.org; Sun, 25 Jul 2010 20:07:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41615) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdBEE-0006ZU-J9 for bug-gnu-emacs@gnu.org; Sun, 25 Jul 2010 20:07:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OdAtO-0004iV-J4; Sun, 25 Jul 2010 19:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Jul 2010 23:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6716 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6716-submit@debbugs.gnu.org id=B6716.128010151718113 (code B ref 6716); Sun, 25 Jul 2010 23:46:02 +0000 Original-Received: (at 6716) by debbugs.gnu.org; 25 Jul 2010 23:45:17 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdAse-0004i6-MY for submit@debbugs.gnu.org; Sun, 25 Jul 2010 19:45:16 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdAsc-0004i0-I2 for 6716@debbugs.gnu.org; Sun, 25 Jul 2010 19:45:14 -0400 Original-Received: from ceviche.home (vpn-132-204-232-49.acd.umontreal.ca [132.204.232.49]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o6PNjEFd031008; Sun, 25 Jul 2010 19:45:15 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 41A5A660B6; Mon, 26 Jul 2010 01:45:13 +0200 (CEST) In-Reply-To: <874ofpqeiu.fsf@gmail.com> =?UTF-8?Q?("=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec"'s?= message of "Sat, 24 Jul 2010 13:56:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3585=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 25 Jul 2010 19:46:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38924 Archived-At: > Because `find-library-name' receives as its LIBRARY argument the full > path, but doesn't strip the directory part, setting > `find-function-source-path' has no effect on symbol finding -- Emacs > still tries the path guessed according to load path (which is not > correct in case you have the Elisp sources in directory different from > the compiled files). The file name has been changed to a full absolute name to avoid showing the wrong file when there's some shadowing going on. So your patch would re-introduce this problem. Also, it may not work for files that were loaded as "foo/bar". I think the load-history needs to be changed to keep track of both the absolute file name and the name used to load the file (i.e. "/bla/bla/foo/bar.elc" and "foo/bar"). Then in find-function-source-path we will first try for /bla/bla/foo/bar.el and when that fails we can fall back on searching for foo/bar.el. Stefan > This simple change seems to fix it for me: > diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el > index 216d91b..f704c63 100644 > --- a/lisp/emacs-lisp/find-func.el > +++ b/lisp/emacs-lisp/find-func.el > @@ -150,10 +150,10 @@ (defun find-library-name (library) > (if (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library) > (setq library (replace-match "" t t library))) > (or=20 > - (locate-file library > + (locate-file (file-name-nondirectory library) > (or find-function-source-path load-path) > (find-library-suffixes)) > - (locate-file library > + (locate-file (file-name-nondirectory library) > (or find-function-source-path load-path) > load-file-rep-suffixes) > (error "Can't find library %s" library))) > Regards, > =C5=A0t=C4=9Bp=C3=A1n