Lars Magne Ingebrigtsen larsi@gnus.org writes:
- (defun slime-start-and-load ()
- "Start Slime, load the current file and set the package."
- (interactive)
- (let ((package (slime-find-buffer-package)))
(if (not package)
(error "No package to load")
(slime)
(while (not (slime-connected-p))
(sit-for 0.1))
(slime-repl-send-string
(format "(progn (load \"%s\") (in-package %s))\n" package package)))))
I committed a patch that loads the current file, not the package. Is that OK?
By convention we don't send snippets of CL code to lisp, especially not encoded as strings (problematic with non-standard reader syntax). The preferred way is to use slime-eval-async or slime-eval and write the function in CL directly.
Helmut.