Cursor keys for *NIX

Luke Gorrie <>
Wed Nov 27 16:47:40 CET 2002


Sean Hinde <> writes:

> > (We all run the erlang shell in an Emacs buffer with erlang-mode's M-x
> > run-erlang, right? :-))

This was a joke btw - I think better support for line editing in the
erlang shell would be great. I have implemented something like this in
Ermacs - the data structures involved probably make it pretty
nonportable for putting in edlin, but anyway the code is:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ermacs/ermacs/src/edit_lib.erl?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup

(Actually the code can be much nicer if you represent the current line
as a list of characters - the ermacs code is a bit hairy since I used
an abstract data type for all text. Maybe that code is better ignored :))

I've frequently heard grumbling around the office that persistent
command history should be implemented too (I have that in Ermacs'
erlang shell :-)).

> C-x 2
> C-x 1
> C-x C-s

The way I use it is this: any time I need the erlang shell, I type
"C-c C-z", and it splits the window in two and puts the cursor in the
shell. When I'm done with the shell I press "C-x 0", which unsplits
the window and leaves me back in the source.

If you want to tweak the way the shell is started, you can hack the
variables inferior-erlang-machine and inferior-erlang-machine-options
(lemme know if you want an example.) In our system I configure these
to connect an erlang shell to the already-started node where the
system is running (via a special shell command we already have.)

Cheers,
Luke




More information about the erlang-questions mailing list