Subject: Remapping pine keys

From: [email-masked] (David McCullough Dobson)
Date: 20 Jul 1994 20:53:04 GMT

Is there any way to remap keys in pine?  I am particularly interested in 
using Esc instead of ^C and anything instead of ^^.

Thanks,

Dave

---

From: [email-masked] (Barry Bouwsma)
Date: Thu, 21 Jul 1994 13:56:05 GMT

>using Esc instead of ^C and anything instead of ^^.

    The problem with using ESC is that it is the prefix character used
for arrow keys on many terminals.  Pine can figure out whether you typed
an arrow key or an ESC if it is followed by another character (I believe
Pine also understands a few other ESC sequences from ISO 2022).  But, if
no character follows the ESC, as if you've decided to cancel a message
in composition, Pine can't tell if you've just hit ESC, or an arrow key,
whose remaining characters (perhaps [A ) will arrive shortly if a packet
got lost somewhere.
    I guess this could work in the highlighted prompt (PINE EMERGENCY EXIT:
Really ABORT, dump CORE, and reboot the SYSTEM right NOW??!? [y/n/^C]) where
a single character is expected.
    Also, you can start Pine in a mode where function keys execute the
commands, instead of control characters.

Barry Bouwsma
<[email-masked]> or usually <[email-masked]>

---

From: "My account in Košice (Hacker Barry)" <[email-masked]>
Date: Fri, 22 Jul 1994 19:03:17 +0200

On Thu, 21 Jul 1994, Barry Bouwsma wrote:

> Pine also understands a few other ESC sequences from ISO 2022). 

    I got to thinking last night, which seems to happen sometimes when I 
should be sleeping.  I've inadvertently used some Emacs META-whatever 
commands as ESC-whatever while in Pico, which appear to be bound to not 
Emacs functions, but the vi *beep* function.  So, why shouldn't Pico
understand these ESC sequences too.

    I am aware that one of the original design goals of Pine was a 
simple, user-friendly MUA, thus the help lines at the bottom, and the 
decision to use single control-key commands for all functions.  Well, 
from what I understand, Pine3.90 will break that tradition by using a 
pair of keys to move to the beginning and end of a text.  I am not 
suggesting you abandon the current keymappings, but, I just checked to 
see what results various ESC-whatever would get me.

    I was speculating that ESC is reserved to be followed by...
another ESC, for use when a control key doesn't work;
[ for some arrow keys
O for some function keys
ABCD for other arrow keys
and probably a bunch more for ISO 2022 sequences, like ( and - (I know 
absolutely nothing about ISO 2022).
However, when I type ESC < or > or f or v, as well as others, I get a 
beep.  I must admit, I can't tell if the beep is instantaneous or delayed 
as Pine waits for another character, since I'm six timezones away from 
the Pine I'm using, and round-trip times are on the order of 15 seconds 
to minutes.

    So, what I'm wondering is if it would be possible, if these keys are 
not reserved for some other future use, to bind certain characters 
following ESC to the corresponding Emacs function as an Undocumented 
Feature and convenience to certain users.  Some of the ones I can think 
of that will be covered by existing Pine commands in 3.90 would be ^@ -> 
ESC f (I see no need to bind the uppercase letter, particularly when a 
VT52-like terminal uses those for arrow keys), the ESC < and > functions, 
and ESC v for ^Y.
    If the Pine Team is really into it, other presently unimplemented
functions could be bound too, like ESC b (back one word) or ESC d (delete
forward word) or ESC DEL/BS (delete backward word) or ESC nnn (numeric
argument, like ESC 15 ^K to delete 15 lines), to accommodate power users
who like the Pico interface but are too attached to powerful Emacs
commands.  This would make sense if there were plans to include those
functions bound to Pico command keys in a future release, but I'm not
suggesting you add such code just for an Undocumented Feature that could
be eliminated in a later Pine. 
    Of course, I could use Emacs as my alternative editor, but it seems 
like it would be a simple matter to make Pico more accommodating without 
compromising its functionality by understanding these currently unbound 
key sequences, such as ESC v as well as ^Y or ESC ESC Y.

    Anyway, just a thought, and a sign I need to try other things to get 
to sleep

Barry Bouwsma
<[email-masked]>  <[email-masked]>  </dev/null@localhost>