GNU bug report logs - #6716
23.2; Setting `find-function-source-path' has no effect.

Previous Next

Package: emacs;

Reported by: Štěpán Němec <stepnem <at> gmail.com>

Date: Sat, 24 Jul 2010 11:58:02 UTC

Severity: normal

Tags: moreinfo

Found in version 23.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 6716 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Štěpán Němec <stepnem <at> gmail.com>
Cc: 6716 <at> debbugs.gnu.org
Subject: Re: bug#6716: 23.2; Setting `find-function-source-path' has no effect.
Date: Mon, 26 Jul 2010 01:45:13 +0200
> 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 
> -   (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,

>   Štěpán






This bug report was last modified 3 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.