I wrote an interpreter by leveraging --batch
, read-from-minibuffer
and princ
. Now, reading input is relatively limited, you can type consecutive characters, erase the last character with <backspace>
, send a line with RET
and cancel input with C-d
(or C-c
, but that aborts the entire program). This is good enough for testing, but I'd like to shoot for more readline-like editing. Is it possible to intercept individual control keys before printing them and how?
I ended up writing my own readline thing with the help of @ack006. It consists of a shell script enabling raw mode and sending one character at a time to an Emacs in batch mode which interprets the key sequences accordingly and emits ANSI escapes to pretend line editing.
I'd still appreciate an answer involving the new module support.
rlwrap
though. I'd accept an answer involving the former. – wasamasa Mar 15 '16 at 12:50