[Top][All Lists]

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

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

From: Stefan Monnier
Subject: bug#6716: 23.2; Setting `find-function-source-path' has no effect.
Date: Mon, 26 Jul 2010 01:45:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> 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.


> 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

reply via email to

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