Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get basic App<->Emacs integration?

Tags:

emacs

elisp

There are a bunch of applications out there that integrate Emacs with external processes. GDB is one that comes to mind. I can control GDB from emacs and then get feedback on the screen.

I'd like to do something in that direction with my application.

Here's what I want:

  • establish a connection between me and emacs. I'd probably start a new emacs process and slurp it into my GUI
  • tell emacs to display a file. (easy with emacsclient)
  • tell emacs to scroll to center on a particular line number and hilite or just move the cursor there.
    • Probably the real question is how do I send arbitrary elisp code from my external app for emacs to execute.
    • I don't speak elisp, but this would be a great excuse to learn
  • provide some clickable areas in the emacs buffer that, when triggered, will send a message back to my app.
    • Even short of clickability, a key-binding that sends the message would be a start. (but I know the clickable thing is possible, so I'm asking)

I know that this is all possible (what isn't possible in emacs?), but I just don't know where to start googling.

like image 975
mmccoo Avatar asked Mar 30 '09 22:03

mmccoo


1 Answers

You might want to look at Distel (an integration of Emacs with Erlang's message system) and SLIME (an interface between Emacs and Common Lisp). These are two Emacs modes that involve a quite impressive integration of another system by talking to it asynchronously. In particular, there is a paper on how Distel was implemented, along with some other good information on how it works here.

like image 79
Brian Campbell Avatar answered Oct 24 '22 11:10

Brian Campbell