Quesstion about Alt-. navigation to function definitions
eller.helmut at gmail.com
Thu Oct 31 08:07:58 UTC 2013
On Wed, Oct 30 2013, Christophe Rhodes wrote:
> I think I can reproduce the problem.
> /tmp/bar.asd containing:
> (asdf:defsystem bar :contents ((:file "baz")))
> /tmp/baz.lisp containing:
> (defun frob (x) (1+ x))
> /tmp/foo.lisp containing:
> (require :bar)
> and neither /tmp/foo.fasl nor /tmp/bar.fasl existing, then executing
> from the toplevel
> (load "/tmp/bar.asd")
> and subsequently hitting C-c C-c on the (require :bar) form in foo.lisp
> will result in (describe 'frob) thinking that it has a source location
> of foo.lisp, rather than baz.lisp.
Indeed. I can reproduce that too. If we do it without ASDF we
(load (compile-file "baz.lisp"))
in foo.lisp and press C-c C-c on it.
This happens because SWANK-COMPILE-STRING in swank-sbcl.lisp uses with
WITH-COMPILATION-UNIT to pass :source-namestring to nested invocations
of COMPILE-FILE. Since LOAD is also called inside that
WITH-COMPILATION-UNIT the invocation in foo.lisp picks up the wrong
value for :source-namestring.
I moved LOAD outside and this problem should no longer occur. A
potential downside is that (redefinition) warnings that are emitted
during LOAD are no longer picked up by SLIME.
More information about the slime-devel