15

I'm looking into doing the following: I have a program written in Common Lisp, which I want to be able to communicate with Emacs. The program deals with natural language parsing, so the things I'd need to access in Emacs would be the contents of the buffer and some minimal preliminary parsing required to create messages to send to the Common Lisp program. The Common Lisp program will then process the messages and reply to the Emacs Lisp program, so that it will display the results.

I understand that SLIME would be a good tool to use to achieve this, mainly because it already does most of it, but looking into documentation I find that it's a "user documentation" kind, not a "developer documentation". Essentially, I would like to know what is the minimum that I could use on the Emacs Lisp side to get the communication going (I certainly don't need the introspection, or REPL in this case, all I need is to send messages to and from my program running in SWANK).

7

From the CL side the function you are looking for is swank::eval-in-emacs to which you pass a the code you want to evaluate in emacs. You can see an example here, to make emacs run the graphivz command and open the resulting png in a buffer. From the emacs side the function you are looking for is slime-eval (found in slime.el)

  • Sorry, it took me a while to get back to it. – wvxvw Nov 10 '14 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.