🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
4 messages
4 total messages Started by he... Heikki Kantola Fri, 17 Apr 1998 00:00
Slrn: binding same slang macro to multiple keys and posting failures
#40202
Author: he... Heikki Kantola
Date: Fri, 17 Apr 1998 00:00
23 lines
1562 bytes

It took me a while to detect that error message:
	[...]
	loading /home1/ykielo/hkantola/.slrn.sl
	S-Lang Error: Inconsistency in define key.
	[...]
means that one can't bind same Slang macro to more than one key at
time without using stupid hacks ie. making extra functions to call
the original macro. Why is it so? 

Secondly while trying to post the text above first time, my network
connection got lost and posting failed. Annoyingly Slrn just said that
and gave no option to either retry or postpone the article, luckily
one can surely reuse .article/.followup/.letter-files, but that needs
too much manual work IMHO...

-- 
Heikki "Hezu" Kantola, <Heikki...@IKI.FI>
Lähettämällä mainoksia tai muuta asiatonta sähköpostia yllä olevaan
osoitteeseen sitoudut maksamaan oikolukupalvelusta FIM500 alkavalta
tunnilta.
Re: Slrn: binding same slang macro to multiple keys and posting failures
#40193
Author: lah... Jan Hlavacek
Date: Fri, 17 Apr 1998 00:00
62 lines
2725 bytes

On 17 Apr 1998 11:40:57 GMT, Heikki Kantola <he...@iki.fi> wrote:
> It took me a while to detect that error message:
> 	[...]
> 	loading /home1/ykielo/hkantola/.slrn.sl
> 	S-Lang Error: Inconsistency in define key.
> 	[...]
> means that one can't bind same Slang macro to more than one key at
> time without using stupid hacks ie. making extra functions to call
> the original macro. Why is it so? 

I have this in my .slrn.sl:

definekey ("my_fun", "^A", "article");
definekey ("my_fun", "^T", "article");

which works peaches.  If I change it to

definekey ("my_fun", "^A", "article");
definekey ("my_fun", "^A^T", "article");

i don't get any error,  but the first line is ignored.

If I change it to

definekey ("my_fun", "^A^T", "article");
definekey ("my_fun", "^A", "article");

I get S-Lang error: Incostency in ...

If I change it to

definekey ("my_fun", "^A^T^A", "article");
definekey ("my_fun", "^A^T", "article");

definekey ("my_fun", "^A^T", "article");
definekey ("my_fun", "^A^T^A", "article");

I get the above error.

As far as I can tell by examining the source,  these are the only
situations where this error occures.  I thing the reason is that if you
map something to "^A",  and something else is already mapped to "^A",
you just loose the one mapping,  which gets redefined by the new one.

However,  if there is something mapped to "^A^T",  it means that "^A" is
a "prefix" and there can possibly be whole bunch of other stuff starting
with "^A",  so redefining "^A" can cause you to loose whole bunch of
mappings.

It has nothing to do with the function you are mapping it to.

I am afraid I am not very clear here.  It's too early in the morning.

lahvak
-- 
Jan Hlav\'{a}\v{c}ek <lah...@math.mps.ohio-state.edu>  (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/
Re: Slrn: binding same slang macro to multiple keys and posting failures
#40216
Author: he... Heikki Kantola
Date: Sat, 18 Apr 1998 00:00
42 lines
2528 bytes

Jan Hlavacek <lah...@math.mps.ohio-state.edu> informed
news.software.readers with the following:
>On 17 Apr 1998 11:40:57 GMT, Heikki Kantola <he...@iki.fi> wrote:
>> It took me a while to detect that error message:
>> 	[...]
>> 	loading /home1/ykielo/hkantola/.slrn.sl
>> 	S-Lang Error: Inconsistency in define key.
>> 	[...]
>> means that one can't bind same Slang macro to more than one key at
>> time without using stupid hacks ie. making extra functions to call
>> the original macro. Why is it so? 

[several examples]

>As far as I can tell by examining the source,  these are the only
>situations where this error occures.  I thing the reason is that if you
>map something to "^A",  and something else is already mapped to "^A",
>you just loose the one mapping,  which gets redefined by the new one.
>
>However,  if there is something mapped to "^A^T",  it means that "^A" is
>a "prefix" and there can possibly be whole bunch of other stuff starting
>with "^A",  so redefining "^A" can cause you to loose whole bunch of
>mappings.
>
>It has nothing to do with the function you are mapping it to.
>
>I am afraid I am not very clear here.  It's too early in the morning.

It was clear enough that I got idea what this "feature" is about:
looks like if you try to bind key combinations with similar beginning
(in my case it was two escape sequences which different terminals 
appear to generate from left arrow key) you can't bind them to same
function...

-- 
Heikki "Hezu" Kantola, <Heikki...@IKI.FI>
Lähettämällä mainoksia tai muuta asiatonta sähköpostia yllä olevaan
osoitteeseen sitoudut maksamaan oikolukupalvelusta FIM500 alkavalta
tunnilta.
Re: Slrn: binding same slang macro to multiple keys and posting failures
#40427
Author: da... John E. Davis
Date: Sun, 26 Apr 1998 00:00
172 lines
5525 bytes

On 18 Apr 1998 10:13:55 GMT, Heikki Kantola <he...@iki.fi>
wrote:
>It was clear enough that I got idea what this "feature" is about:
>looks like if you try to bind key combinations with similar beginning
>(in my case it was two escape sequences which different terminals 
>appear to generate from left arrow key) you can't bind them to same
>function...

If you use different terminals, whose keys generate conflicting
escape sequences, then you can do:

#if$TERM xterm
  % xterm specific bindings here
#elif$TERM linux vt102
  % put linux console or vt102 bindings here
#elif$TERM vt320
  % put vt320 bindings here
#endif

If your terminfo/termcap files contain information about the escape
sequences that your arrow and function keys generate, then you can use
an escape sequence of the form "^(XX)" where XX indicates the
termcap/terminfo entry.  For example, suppose you want to bind the
LEFT arrow key to some function in article mode.  Then you can use:

    setkey article some_function "^(kl)"

Similarly, `ESC F1' may be specified by "\e^(k1)".  In these examples,
`kl' is the temcap cabibility name for the left arrow key, and `k1' is
the capability for the F1 function key.  

Below, you will find a table of all the two character ^(XX)
combinations that the slang library recognizes.  Keep in mind that
many termcap/terminfo files may lack this information, and most
terminals will not have the all the keys in the table.  This table was
adapted form slang/src/sltermin.c.

  #2     Key S-Home
  #3     Key S-Insert
  #4     Key S-Left
  %0     redo key
  %1     help key
  %2     mark key
  %3     message key
  %4     move key
  %5     next key
  %6     open key
  %7     options key
  %8     previous key
  %9     print key
  %c     Key S-Next
  %e     Key S-Previous
  %i     Key S-Right
  &1     reference key
  &2     refresh key
  &3     replace key
  &4     restart key
  &5     resume key
  &6     save key
  &7     suspend key
  &8     undo key
  *4     Key S-Delete
  *5     shifted key
  *6     select key
  *7     Key S-End
  @0     find key
  @1     begin key
  @2     cancel key
  @3     close key
  @4     command key
  @5     copy key
  @6     create key
  @7     Key End
  @8     enter/send key
  @9     exit key
  F1     key_f11
  F2     key_f12
  F3     key_f13
  F4     key_f14
  F5     key_f15
  F6     key_f16
  F7     key_f17
  F8     key_f18
  F9     key_f19
  FA     key_f20
  FB     F21 function key
  FC     F22 function key
  FD     F23 function key
  FE     F24 function key
  FF     F25 function key
  FG     F26 function key
  FH     F27 function key
  FI     F28 function key
  FJ     F29 function key
  FK     F30 function key
  FL     F31 function key
  FM     F32 function key
  FN     F33 function key
  FO     F34 function key
  FP     F35 function key
  FQ     F36 function key
  FR     F37 function key
  FS     F38 function key
  FT     F39 function key
  FU     F40 function key
  FV     F41 function key
  FW     F42 function key
  FX     F43 function key
  FY     F44 function key
  FZ     F45 function key
  Fa     F46 function key
  Fb     F47 function key
  Fc     F48 function key
  Fd     F49 function key
  Fe     F50 function key
  Ff     F51 function key
  Fg     F52 function key
  Fh     F53 function key
  Fi     F54 function key
  Fj     F55 function key
  Fk     F56 function key
  Fl     F57 function key
  Fm     F58 function key
  Fn     F59 function key
  Fo     F60 function key
  Fp     F61 function key
  Fq     F62 function key
  Fr     F63 function key
  K1     upper left of keypad
  K2     center of keypad
  K3     upper right of keypad
  K4     lower left of keypad
  K5     lower right of keypad
  k0     F0 function key
  k1     F1 function key
  k2     F2 function key
  k3     F3 function key
  k4     F4 function key
  k5     F5 function key
  k6     F6 function key
  k7     F7 function key
  k8     F8 fucntion key
  k9     F9 function key
  k;     F10 function key
  kA     insert-line key
  kB     back-tab key
  kC     clear-screen or erase key
  kD     delete-character key
  kE     clear-to-end-of-line key
  kF     scroll-forward key
  kH     last-line key
  kI     insert-character key
  kL     delete-line key
  kN     next-page key
  kP     prev-page key
  kR     scroll-backward key
  kS     clear-to-end-of-screen key
  kT     set-tab key
  ka     clear-all-tabs key
  kb     backspace key
  kd     down-arrow key
  ke     leave 'keyboard_transmit' mode
  kh     home key
  kl     left-arrow key
  ko     list of self-mapped keycaps
  kr     right-arrow key
  ks     enter 'keyboard_transmit' mode
  kt     clear-tab key
  ku     up-arrow key
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads