Distel, the other way around

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Wed Dec 17 08:59:45 CET 2003


Hi,

I got this idea that might not be new (but then I'd love to hear why it doesn't
work). I suppose Luke should have been thinking about something like this.

I think I am not alone when I wish there was a nicer interface to Erlang than
the shell, visually and functionally. Distel is a great tool, but what I'd like
to see is more like how Mozart/Oz does it: the integration is tighter, and there
are colors ;-)

This is why I thought: why not use Distel the other way around, to drive Emacs
from Erlang. If we can call Emacs functions from Erlang, then we can build a
nice front-end.

One way to do this would be to implement something like the ncurses API, that
talks to Emacs. There might even exist an Emacs package that implements this,
even if I couldn't find it yet.

Another way, the more interesting one, is to open up Emacs with all its
functionality to Erlang. How on earth do that without growing old while writing
interfaces, you ask?

We can just send to a Distel buffer something like
    Buffer ! {execute, do_something, Args}
    (or a rpc call if we want an answer)
where do_something should be an elisp function.

This can be encapsulated into emacs:call(Buffer, do_something, Args), or even
nicer into an emacs:do_something(Buffer, Args). The latter could be either
transformed by a parse_transform (nah!) or caught by emacs:undefined_function/2
who will know what to do.

Is this reasonable?

regards,
Vlad




More information about the erlang-questions mailing list