Search code examples
common-lispslimeccl

On Slime Load , change default package from Cl-USER


When we start slime, it starts in CL-USER by default. Since I work with a particular package very frequently, I want to automatically in-package into that package on slime startup. i.e. I want save myself the trouble of doing the below:

CL-USER> (ql:quickload :my-package)
CL-USER> (in-package my-package)
MY-PACKAGE>

I tried putting the following code in my ccl-init.lisp file but the in-package did not work:

(ql:quickload :my-package)
(in-package my-package)

Solution

  • You probably could do something with slime-repl-mode-hook

    But I think it would be better to use the slime-sync-package-and-default-directory which is bound to C-c ~ and syncs your REPL to the package of your buffer.