[slime-devel] Running CL code from elisp, and vice versa

Harald Hanche-Olsen hanche at math.ntnu.no
Mon Feb 13 16:46:11 UTC 2006


+ Helmut Eller <heller at common-lisp.net>:

|  (slime-eval-async `(cl:lisp-implementation-type) 
| 	 	    (lambda (x) (message "%S" x)))
| 
| Note that slime-eval-async is intended to write SLIME commands and is
| a bit picky what you put in the expression.

Indeed, but I can live with that.  It's just a question of packing it
up into an elisp function that enforces the constraints.

| > And, while we're at it, how about the backend lisp asking emacs to run
| > some elisp code?
| 
| swank::eval-in-emacs does that, but we use it rarely and the whole
| Lisp->Emacs communication isn't very mature.  E.g.
| 
|  (swank::eval-in-emacs '(emacs-version))

That works, but (swank::eval-in-emacs '(find-file "/tmp/foo")) killed
the slime connection.  (But it did run open a buffer on /tmp/foo
first.)  It also produced quite a lot of information in the
*inferior-lisp* buffer.  I have saved it in a file, so if anybody
would like to see it, drop me a note.  But I bet y'all can reproduce
this yourselves.

Wait, I think I see what is happening:  The find-file returns the
value #<buffer foo>, which is probably too hard to handle.
But this works fine:

(swank::eval-in-emacs '(progn (find-file "/tmp/foo") t))

Thanks for the help.

- Harald



More information about the slime-devel mailing list