🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #35915

Re: Wish List for SLRN

#35915
From: Jan Hlavacek
Date: Thu, 28 Aug 1997 00:00
93 lines
3623 bytes
On 27 Aug 1997 17:36:26 GMT, Clint Olsen <olsenc@kodiak.ee.washington.edu>
wrote:
> I tried this in my .slrn.sl file:
> 
> % Function definitions
> 
> define article_pagedn ()
> {
>   if (is_article_visible ())
>     call ("scroll_dn");
>   else  call ("pagedn");
> }
> 
> definekey ("article_pagedn", " ", "article");     % use nifty slang function
> 

article_pagedn is an internal function.  When executing a key,  slang first
looks for internal function,  then for an interpreter function.  So if there
is an internal function with the given name,  your function never gets
executed.  So all you have to do is to change the name of your function.

BTW,  a list of slrn internal functions is at 

http://www.math.ohio-state.edu/~lahvak/software/slrn/internals.html

> I want the space bar to go to the next page of articles (kind of like trn)
> when no article is showing, but I cannot seem to get it to work.  Any ideas
> what I might be doing wrong?  I tried to use a binding to something that
> wasn't being used by setkey since I wasn't sure what would happen if you
> attempted to overload a setkey with a definekey.  I also found it rather

Apply included patch to startup.c.  It will allow you to put little pieces of
slang code into your .slrnrc.  You can put the following to your .slrnrc:

eval "define my_useless_function () {message (\"useless function executed\")}"

setkey article my_useless_function "M"

--- startup.c.old	Thu Aug 28 04:49:48 1997
+++ startup.c	Thu Aug 28 05:19:46 1997
@@ -60,6 +60,7 @@
 static int grouplens_fun (int, SLcmd_Cmd_Table_Type *);
 static int interpret_fun (int, SLcmd_Cmd_Table_Type *);
 static int include_file_fun (int, SLcmd_Cmd_Table_Type *);
+static int eval_slang_fun (int, SLcmd_Cmd_Table_Type *);
 
 /*}}}*/
 /*{{{ Static Global Variables */
@@ -89,6 +90,7 @@
      {interpret_fun, "interpret", "S"},
      {include_file_fun, "include", "S"},
      {user_data_fun, "scorefile", "S"},
+     {eval_slang_fun, "eval", "S"},
    
    /* The following are considered obsolete */
      {user_data_fun, "username", "S"},
@@ -1154,6 +1156,27 @@
    (void) argc;
    return 0;
 #endif
+}
+
+/*}}}*/
+
+static int eval_slang_fun (int argc, SLcmd_Cmd_Table_Type *table) /*{{{*/
+{
+#if SLRN_HAS_SLANG
+   char *slang = table->string_args [1];
+   
+   (void) argc;
+   if (Slrn_Use_Slang == 0) return 0;
+   SLang_load_string (slang);
+   if (SLang_Error) 
+     {
+        SLang_Error = 0;
+        return -1;
+     }
+#else
+   (void) argc;
+#endif
+   return 0;
 }
 
 /*}}}*/

-- 
Jan Hlav\'{a}\v{c}ek <lahvak+n@math.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: <slrn60ai4o.cmg.lahvak+n@math.mps.ohio-state.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <5tngmu$c8c$1@news.one.net> <slrn5vuros.k3s.lahvak+n@math.mps.ohio-state.edu> <slrn608pgm.i3r.olsenc@misha.ee.washington.edu>

Show Full Headers
Complete Article Headers
Message-ID: <slrn60ai4o.cmg.lahvak+n@math.mps.ohio-state.edu>
Subject: Re: Wish List for SLRN
Date: Thu, 28 Aug 1997 00:00:00 +0000
From: lahvak+n@math.ohio-state.edu (Jan Hlavacek)
References: <5tngmu$c8c$1@news.one.net> <slrn5vuros.k3s.lahvak+n@math.mps.ohio-state.edu> <slrn608pgm.i3r.olsenc@misha.ee.washington.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 268729875
Organization: Department of Mathematics, The Ohio State University
Reply-To: lahvak+n@math.ohio-state.edu
Newsgroups: news.software.readers