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)))
Thanks, Raghavendra.
"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
At 2009-05-18T01:58:42+04:00, Stas Boukarev wrote:
Solution is either not to load contribs asynchronously:
diff --git a/slime.el b/slime.el index f6768a8..8d4b9cb 100644 --- a/slime.el +++ b/slime.el ... 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
Thank you very much, and sorry for the delay in replying. The setting in ~/.swank.lisp that you've suggested works, as does setting the variable there to `:fd-handler' or `nil'.
Best regards, Raghavendra.