Key bindings

Sean Hinde <>
Tue Nov 26 20:44:48 CET 2002


> Having looked at that I see now that if I were emacs literate I
> could probably do all the things I would want that readline provides.
> I guess I'll shut up now and either stay with the status quo or go
> and write a vi-like edlin.erl.

OK, here's a patch to edlin which does backwards and forwards keys for at
least OS X. It should work on Solaris (I think) but my machine has not
revovered from the office DNS outage several hours ago so I can't test it (I
rely on the ESC[C type of thing which seems quite common).

edlin.erl doesn't do "previous line" and "next line" (perhaps forgivable
given its name) so back to hunting around..

Sean


--- edlin copy.erl	Wed Oct  2 22:14:43 2002
+++ edlin.erl	Tue Nov 26 19:30:50 2002
@@ -69,6 +69,8 @@
     case key_map(C, Prefix) of
 	meta ->
 	    edit(Cs, P, {Bef,Aft}, meta, Rs0);
+	meta_left_sq_bracket ->
+	    edit(Cs, P, {Bef,Aft}, meta_left_sq_bracket, Rs0);
 	ctlx ->
 	    edit(Cs, P, {Bef,Aft}, ctlx, Rs0);
 	new_line ->
@@ -171,6 +173,9 @@
 key_map($y, meta) -> yank_pop;
 key_map($\177, none) -> backward_delete_char;
 key_map($\177, meta) -> backward_kill_word;
+key_map($[, meta) -> meta_left_sq_bracket;
+key_map($D, meta_left_sq_bracket) -> backward_char;
+key_map($C, meta_left_sq_bracket) -> forward_char;
 key_map(C, none) when C >= $\s ->
     {insert,C};
 key_map(C, _) -> {undefined,C}.



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list