Hi Thorsten,
> I already have a basic emacs commandline version running, the most basic
> Emacs 'movement, deletion and paste' commands, just by changing the
> keybinding of existing functions to Emacs bindings with <Ctrl>prefix.
Nice!
> But there are still several things I don't really understand:
> ...
> ,------------------------------------------------
> | *XtMenu "^[[29~" #?
> `------------------------------------------------
>
> where do I find the explanation for "^[[29~"?
I should explain that "^[" is the ASCII code for ESC (escape)
: (char "^[")
-> 27
Most function keys are defined as "Escape-Sequences".
> > But these examples don't handle sequences of multiple-key events. For
> > those, a given key like Ctrl-X might then wait for a short timeout
> > period (e.g. with (key 200)) for further keys to arrive.
>
> could you give a little example how this would look like, e.g. if I want
> to define the Emacs binding 'C-x u' ('<Ctrl>-x u'), i.e. press C-x first
> (as a prefix) and then u?
It is difficult to describe an example outside of a usable context, but
assuming you have a case similar to '_getLine' in "lib/led.l", then you
could wait upon recognition of Ctrl-C for a second character, and
dispatch on that one, e.g.:
(case "C"
...
("^X" (and (key 500) (prinl "Ctrl-X + " @)))
...
> I redefined <Ctrl>D to <Ctrl>Q, that was easy.
> (What about <Ctrl>C - where is that defined?)
Ctrl-C is actually not defined as a special key, but as a signal
handler. Depending on the 'stty' settings, a SIGINT signal is sent to
the process when Ctrl-C is pressed.
If this is not desired, then some other key (or none) must be set in the
terminal settings. This can be done with
$ stty intr ^A
or, from inside PicoLisp
(call 'stty "intr" "^A")
I don't know how to completely switch off 'intr' with 'stty'.
Cheers,
- Alex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe