Portacle - why does function intellisense stop working when I visit a file (it works in the repl)

Viewed 141

I am very new to emacs and lisp, so I am starting with portacle. When it starts up in the repl I can define functions and then when I use them I get some intellisense at the bottom referring to the parameter names. However, when I open a file intellisense does not work for the new file.

How do I get intellisense (parameter names of a function) to work for a file the same way it works when I am in the repl?

1 Answers

What you're calling 'intellisense' is what emacs / SLIME calls 'completion' (either is a fine name, but the older & more general term will make more sense to Lisp people).

And as Rainer suggests in a comment the reason that you don't get anything useful for a file, is because the way this works is that Emacs secretly talks to the Lisp implementation (SBCL in this case I think) and asks it, pretty much 'tell me things about this thing', and SBCL can only do that if it knows anything about 'this thing', and until it has loaded the file concerned, it doesn't.

I don't know what Portacle's bindings are, but the way you would load a file in a more simple-minded SLIME environment is, when visiting the file in Emacs, to say C-c-C-k (ie control-C control-K), which will compile & load the file.


This approach to life is probably rather alien to people not used to Lisp environments, but in the Lisp world it's more-or-less how things have always been: Lisps are generally incremental systems into which you load code, and as more code gets loaded into the world the world becomes richer and more able to tell you things about the code it has seen. Indeed one approach which at least used to be common was to load a whole bunch of stuff into a Lisp, and then save that running image to be restarted later: these saved images were often called 'world loads', 'bands', 'sysouts' (on certain heretical machines), or just 'images'.

Related