Article View: news.software.readers
Article #63710Re: [slrn] Binding esc 1 control-i
From: Arjan Drieman
Date: Mon, 24 Jul 2000 00:00
Date: Mon, 24 Jul 2000 00:00
107 lines
4016 bytes
4016 bytes
[Also X-posted to alt.lang.s-lang, but no followup set. It depends on
the answer whether it's a slang or slrn issue ;-) I'll read both
groups, please place followups where you think is appropriate. Thanks.]
On 23 Jul 2000 19:05:36 GMT, J.B. Nicholson-Owens
<j...@forestfield.org> wrote:
[I downloaded the source for slang and found the documentation. I'll
file a bug to debian later for not including it ;-) Thanks.]
>#v+
> public define my_function ()
> {
> message_now ("This is a test.");
> }
> definekey ("Global->my_function", "\e^C", "article");
> definekey ("Global->my_function", "\e^C", "group");
>#v-
>
>and it worked as I expected--only Global->my_function() was executed.
This is driving me batty, nuts, insane, everything %-)
I've got this now:
#v+
% prototyping
public define main();
public define main_prefix();
define edit_mid_file();
% [...]
undefinekey ("\e^C", "article");
definekey ("Global->main", "\e^C", "article");
definekey ("Global->main_prefix", "^C", "article");
definekey ("Global->main_prefix", "^C", "group");
% Comes in handy while hackin'
define load_script () {
() = evalfile ("/home/duckie/News/slang/cancels.sl");
message("Cancelscript Reloaded.");
}
define edit_mid_file () {
message("edit_mid_file");
}
public define main_prefix () {
switch (get_prefix_arg ())
{case 0 : load_script();}
{case 1 : edit_mid_file();}
{verror ("Operation not supported");}
}
public define main () {
% [...]
}
#v-
Okay and now the weird part. When I fire up slrn, hit esc control-c, I
/still/ get the internal cancel function.
*Until* I reload the script using esc 0 control-c, then esc control-c
gives me my main(). This does *not* happen when I use esc 1 control-c,
for example, only after reloading it. So the esc <N> control-c
functions work fine, but esc control-c doesn't, until I reload the file
with evalfile().
I've also tried omitting the prototyping and putting the definekeys at
the bottom of my script, I've tried to use something like
#v+
implements ("cancels");
static main() { % [...]
definekey ("cancels->main", "\e^C", "article");
#v-
Which should work the same way if I understood the namespaces part
correctly. Same flaky results, so at least that part's okay ;-)
Omitting the binding for "\e^C" and using a
#v+
public define main_prefix () {
switch (get_prefix_arg ())
{case -1 : main();}
% [...]
#v-
also doesn't work, not after reloading through esc 0 control-c either.
What in the world am I doing wrong? Is there another way to load
slang scripts from .slrnrc than
interpret "News/slang/cancels.sl"
or something? Or am I doing something completely stupid here?
I've just tried this with ^I instead of ^C, and then esc control-i
is executed just fine, while esc <N> control-i scrolls the article
window, which is the default behavior...
I'm afraid I won't sleep this week ;-)
Thanks,
Arjan
Technical Details
Message-ID:
<slrn8nnb7b.61s.qhpxvr@quack.node0911.a2000.nl>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mailReferences:
<slrn8nl9t3.bk.qhpxvr@quack.node0911.a2000.nl> <slrn8nmgec.7e.jbn@forestfield.org>Show Full Headers
Complete Article Headers
Message-ID: <slrn8nnb7b.61s.qhpxvr@quack.node0911.a2000.nl> Subject: Re: [slrn] Binding esc 1 control-i Date: Mon, 24 Jul 2000 00:00:00 +0000 From: qhpxvr@abqr0911.n2000.ay.invalid (Arjan Drieman) References: <slrn8nl9t3.bk.qhpxvr@quack.node0911.a2000.nl> <slrn8nmgec.7e.jbn@forestfield.org> 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: 649965345 X-Complaints-To: ab...@a2000.nl X-Trace: tesla.a2000.nl 964406507 708 62.108.9.17 (24 Jul 2000 02:41:47 GMT) Organization: A2000 Kabeltelevisie en Telecommunicatie User-Agent: slrn/0.9.6.2 (Linux) Reply-To: duc...@duckie.neep.net NNTP-Posting-Date: 24 Jul 2000 02:41:47 GMT Newsgroups: news.software.readers,alt.lang.s-lang X-Authors-Homepage: http://duckie.neep.net/