Alexander Burger <> writes:

Hi Alex,

thanks for your explanations. 

>> So <Ctrl> and <Shift> are the only 'meta-keys' that can be used (and
> Yes, they cause the generation of different ASCII characters by the
> keyboard when they are pressed. For example, if you press the 'A' key
> you get the character 97 ('a'), if you press shift, you get 65 ('A'),
> and if you press control, you get 1 ('^A').

my idea is to add an Emacs-like command line to PicoLisp. I thought this
would be about:

1. move all commands from command-mode to insertion-mode (the only
2. eliminate command-mode
3. replace the vi 1-key bindings with Emacs keychords (with Control and
   Meta prefix-keys) for all commands that have equal or similar semantics to
   Emacs commands
4. eliminate/replace the commands that do not fit into the non-modal Emacs
5. write some new commands to give PicoLisp commandline editing the
   authentic Emacs feeling. 

but there is no way to emulate Emacs without the Meta/Alt-key, and e.g.
C-d (<Ctrl>d) is 'delete-char' in Emacs, just like C-c (<Ctrl>c) is a
very common prefix-key.

>> combined)? What about F1 to F12 or any other keys not used for
>> 'self-insertion''? 
> The function keys are usually generated as escape sequences (system
> dependent).
> You may take a look into "lib/term.l" in the PicoLisp distribution. It
> defines some keys from the terminfo database (using 'tput').

this looks easy enough, but I'm still looking for a document that
explains what you are doing there. I found lots of material about
changing colors and positioning text with tput, but nothing yet about
how define keys. Do you have a link or so where this is explained in a
basic way?

Do the definitions in lib/term.l only work in xterm (X11 session) or in
a console session (without X11) too?

>> Would Emacs-like key-chords be possible? E.g. 'C-x u', i.e. type first
>> '<Ctrl>x' and then 'u', using 'C-x' as a kind of prefix that can be
>> combined with e.g. [a-zA-Z0-9].  
> Yes, all this must be handled as events (or sequences of events). Same
> goes for mouse-clicks and -buttons.

Do you have an example of this kind of event-handling in the PicoLisp

>> BTW - where are Ctrl-d and Ctrl-c defined? Could they be redefined to
>> something else in one single place?
> No, they are ASCII values. In general, a control character is the
> corresponding uppercase character minus 64. For example, Ctrl-A is 1,
> Ctrl-B is 2, Ctrl-C is 3 and so on.

But would it be possible to make PicoLisp call 'delete-char' when the
Ctrl-d ASCII is send, and use another (less common) ASCII value to exit
the program? 



Reply via email to