1

I am facing a strange behaviour. When using SBCL (Common Lisp) within Emacs via Slime, after ASDF is used, slime-autodoc does not propose arguments list for functions/macros any more.

I am working with SBCL 2.2.6 + ASDF 3.3.6, within Emacs 28.1 with Slime 2.27.

End goal: I would like that, when I write code, I am proposed the arguments of the version/macro. For instance, when I type "(elt ", the mini-buffer should show: "(elt SEQUENCE INDEX)" For this purpose, I use slime-autodoc, which works fine... except after ASDF is used.

Exemple...

(1) I open SBCL REPL via M-x slime

(2) I define a simple function (defun foo (x) (+ x x))

Autodoc works: if I type "(foo ", it reminds me "(foo X)"

By the way (swank::autodoc '("foo" swank::%cursor-marker%)) returns ("(foo x)" T) and (swank::arglist #'foo) returns (X) NIL

This is OK.

(3) Then I use ASDF to load a personal basic project, with nothing specific (functions working on integers). (swank:operate-on-system-for-emacs "toolbox" 'load-op)

(4) Then I define a new simple function (defun bar (y) (+ y y))

Autodoc does not work any more: when I type "(bar ", it shows "(bar)" in mini-buffer instead of "(bar Y")

With no surprise: (swank::autodoc '("bar" swank::%cursor-marker%)) returns ("(bar)" T) instead of ("(bar Y)" T) and (swank::arglist #'bar) returns () NIL, instead of (Y) NIL

This is not OK.

Important note: autodoc still works for 'foo' function previously defined in (2). It still proposes argument 'X' for it.

I cannot interpret it. It is as if foo and bar were not in the same 'space', as if the use of ASDF has changed the 'space' where things are created. However, we are apparently still in CL-USER package.

Nicolas56
  • 166
  • 2
  • 4
  • Maybe you can load your asdf system with a usual way (C-c C-k, quickload or `asdf:load-asd` etc) see if it works and compare the loading functions called under the hood. – Ehvince Aug 08 '22 at 10:31
  • Is "bar" defined in a different package? are you working with the right bar? maybe the symbol is not exported, etc. which makes it not accessible in the current `*package*` – coredump Aug 08 '22 at 19:10

0 Answers0