🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #38364

Q: error with slrn0.9.4.5 with a macro

#38364
From: Ren� Scholz
Date: Thu, 29 Jan 1998 00:00
104 lines
3929 bytes

hi,

I just compiled the new slrn0.9.4.5 under Solaris.
It works, but I have a Problem with a script from the usenet I use to select
the filename for saveing files.

The error I get is:

S-Lang Error: Stack Underflow: Error while executing my_save

(but not for _all_ groups!).


The last version I used recently was 0.9.3.2.
Here's the source, what should I change: ?



define append_article_save (file)
{
   % Saves the current article to the named file, appending if the file
   % exists.

   if (is_group_mode) return ();        % this only works in article mode

   set_input_string (file);             % put filename in the response stack
   call ("save");                       % save article (into file)
}

define complete_filename (file)
{
   % Append the name of the file to ${HOME}/News/
   % unless it starts with ~ or /
   
   if ((file[0] == '~') or (file[0] == '/')) return (file);
   
   Sprintf ("%s/%s/%s", getenv("HOME"),
	    get_variable_value("save_directory"),
	    file, 3);
}

define get_file_for_group (group)
{
   % Assign a name of an output folder based on the group name.
   % I don't like to have all those really long file names.
   % If the group isn't on the list,  leave it the way it is.
   
   switch (group)
     {case "de.comp.text.tex"                   : "tex10.txt"; }
     {case "de.comp.os.linux.misc"              : "lin37.txt"; }
     {case "comp.emacs.xemacs"                  : "xemacs2.txt"; }
     {case "gnu.emacs.vm.info"                  : "xemacs2.txt"; }
     {case "de.comp.os.unix"                    : "unix2.txt"; }
     {case "de.rec.tv.simpsons"                 : "simpsons.txt"; }
     {case "comp.compression"                   : "Wavelets.txt"; }
     {case "de.sci.mathematik"                  : "math.txt"; }
     {case "de.rec.music.misc"                  : "musik1.txt"; }
     {case "news.software.readers"              : "slrn1.txt"; }
     {case "de.comm.infosystems.www.authoring"  : "html1.txt"; }
     {pop (); group; }
   return ();
}

define my_save ()
{
   % Saves article into a folder based on some criteria.
   % Offers the folder name to edit.
   
   if (is_group_mode) return ();
   
   variable group = current_newsgroup;
   variable subject = strlow(extract_article_header ("Subject"));
   
   % First,  pick a folder name based on group.
   variable file = get_file_for_group (group);
   
   % Then treat some special subjects separately.
   if (is_substr (subject,  "jed")) file = "jed";
   if (is_substr (subject,  "slrn")) file = "slrn";
   
   % Not very likely that I'll edit the name,  
   % if I don't like it,  I'll just type in a new one.
   file = read_mini ("Append to folder", file, "");
   
   append_article_save (complete_filename (file));
}


definekey ("my_save", "o", "article");




thanks,
ren�
-- 
=>  Wenn Debuggen der Vorgang ist, Fehler aus einem Programm auszubauen,    <=
=>  dann ist Programmieren der Vorgang, Fehler in ein Programm einzubauen!  <=
-------------------------- Voland@IRC ----------------------------------------
mrz@informatik.uni-jena.de            http://www2.informatik.uni-jena.de/~mrz/

Technical Details
Message-ID: <6aqrsc$r66$1@fsuj19.rz.uni-jena.de>
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

Show Full Headers
Complete Article Headers
Message-ID: <6aqrsc$r66$1@fsuj19.rz.uni-jena.de>
Subject: Q: error with slrn0.9.4.5 with a macro
Date: Thu, 29 Jan 1998 00:00:00 +0000
From: mrz@isun04.inf.uni-jena.de (Ren� Scholz)
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: 320378271
Content-Transfer-Encoding: 8bit
Mime-Version: 1.0
Reply-To: mrz@informatik.uni-jena.de
Content-Type: text/plain; charset=iso-8859-1
Organization: Lehrstuhl fuer Rechnerarchitektur und -kommunikation, FSU Jena
Newsgroups: news.software.readers