"N. Raghavendra" raghu@mri.ernet.in writes:
Slime with CMUCL starts the Slime REPL in the `swank' package, and the inferior lisp in the `cl-user' package. Is there a way to get the Slime REPL also to start CMUCL in the `cl-user' package? I've tried without success
(defun nr-cmucl-init-command (port-filename coding-system) "Return a string to initialize CMUCL. This is a modified version of `slime-init-command' from `slime.el'." (let ((loader (if (file-name-absolute-p slime-backend) slime-backend (concat slime-path slime-backend))) (encoding (slime-coding-system-cl-name coding-system))) (format "%S\n\n" `(progn (load ,(expand-file-name loader) :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") ,port-filename :coding-system ,encoding) (in-package "CL-USER")))))
(setq slime-lisp-implementations '((cmucl ("/opt/bin/lisp") :init nr-cmucl-init-command)))
In order to load contribs, slime asynchronously evaluates swank-require, in the process of loading them something rebinds *package*. It happens that slime-repl-connected-hook-function gets called and executed at the moment when something changes *package* to SWANK.
Solution is either not to load contribs asynchronously:
or set communication style to :spawn, which will create separate thread for each request, by putting #+cmu (setf swank:*communication-style* :spawn) into ~/.swank.lisp