Thread View: news.software.readers
4 messages
4 total messages
Started by Ren� Scholz
Thu, 29 Jan 1998 00:00
Q: error with slrn0.9.4.5 with a macro
Author: Ren� Scholz
Date: Thu, 29 Jan 1998 00:00
Date: Thu, 29 Jan 1998 00:00
104 lines
3929 bytes
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/
Re: Q: error with slrn0.9.4.5 with a macro
Author: Jan Hlavacek
Date: Fri, 30 Jan 1998 00:00
Date: Fri, 30 Jan 1998 00:00
57 lines
2916 bytes
2916 bytes
On 29 Jan 1998 21:21:16 GMT, Ren� Scholz <mrz@isun04.inf.uni-jena.de>
wrote:
>
> 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: ?
>
OK, I think I recognize this source :-)
There may be few more thing which should be changed, but your problem
seems to be caused by the `pop()' statement et the end of the switch:
> 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; }
^^^^^^^
You want to remove this pop(); Thy syntax of switch statement changed
in the new version os slang.
lahvak
--
Jan Hlav\'{a}\v{c}ek <lahvak@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: Q: error with slrn0.9.4.5 with a macro
Author: Ren� Scholz
Date: Fri, 30 Jan 1998 00:00
Date: Fri, 30 Jan 1998 00:00
26 lines
1541 bytes
1541 bytes
Jan Hlavacek <lahvak@math.mps.ohio-state.edu> wrote:
>OK, I think I recognize this source :-)
>> {pop (); group; }
> ^^^^^^^
>You want to remove this pop(); Thy syntax of switch statement changed
>in the new version os slang.
Yeah, now it works.
But what I _really_ would like, is filename completion with the TAB key (as
in nn).
When will this happen? ;)
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/
Re: Q: error with slrn0.9.4.5 with a macro
Author: Sven Guckes
Date: Fri, 30 Jan 1998 00:00
Date: Fri, 30 Jan 1998 00:00
14 lines
1325 bytes
1325 bytes
mrz@isun32.inf.uni-jena.de (Ren� Scholz): > But what I _really_ would like, is filename completion > with the TAB key (as in nn). When will this happen? ;) I'd be content if JED told us that he is considering to add this at all. ;-) Sven -- The (unofficial) SLRN Wishlist: http://www.math.fu-berlin.de/~guckes/slrn/wish.html
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