🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #40193

Re: Slrn: binding same slang macro to multiple keys and posting failures

#40193
From: 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/
Technical Details
Message-ID: <slrn6jeqs0.jj9.lahvak@math.mps.ohio-state.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail
References: <slrn6jeftq.hqo.hezu@tuuri.ling.helsinki.fi>

Show Full Headers
Complete Article Headers
Message-ID: <slrn6jeqs0.jj9.lahvak@math.mps.ohio-state.edu>
Subject: Re: Slrn: binding same slang macro to multiple keys and posting failures
Date: Fri, 17 Apr 1998 00:00:00 +0000
From: lah...@math.mps.ohio-state.edu (Jan Hlavacek)
References: <slrn6jeftq.hqo.hezu@tuuri.ling.helsinki.fi>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail
X-Deja-AN: 345046801
Organization: Department of Mathematics, The Ohio State University
Reply-To: lah...@math.mps.ohio-state.edu
Newsgroups: news.software.readers,alt.lang.s-lang