Thread View: news.software.readers
25 messages
25 total messages
Started by Lloyd Zusman
Sat, 15 Aug 1998 00:00
[slrn] Preventing an S-Lang macro from aborting.
Author: Lloyd Zusman
Date: Sat, 15 Aug 1998 00:00
Date: Sat, 15 Aug 1998 00:00
61 lines
2324 bytes
2324 bytes
By means of the `interpret' command, I'm loading a group of S-Lang
macros when I start up Slrn (version 0.9.5.2). One of these macros
(enclosed below) is a slight variation on a macro that's included
among the sample macros that come with Slrn: it searches the entire
collection of articles in a newsgroup for occurrences of a specified
regexp.
It works great under normal conditions, but sometimes the news server
I use expires articles whose headers remain. When this happens, the
macro aborts with an error message on the offending article, and I
have to re-invoke it in order to make it continue looping through the
newsgroup. This can be inconvenient when there are a number of
article-less headers in the newsgroup.
Is there any way to modify this S-Lang macro so that it will
automatically skip to the next article instead of aborting when this
kind of error occurs?
Thanks in advance.
------------------------ macro starts here ------------------------
variable Last_Art_Search_Str = "";
define search_newsgroup ()
{
variable str;
variable flags;
str = read_mini ("Search for regexp", Last_Art_Search_Str,
Last_Art_Search_Str);
!if (strlen (str))
return;
Last_Art_Search_Str = str;
uncollapse_threads ();
do
{
flags = get_header_flags ();
if (re_search_article (str))
{
pop ();
return;
}
set_header_flags (flags);
call ("hide_article");
update ();
}
while (header_down (1));
error ("Not found.");
}
--
Lloyd Zusman
l...@asfast.com
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: blue... Dawn Owens-Nicholson
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
19 lines
1552 bytes
1552 bytes
Lloyd Zusman <l...@asfast.com> wrote: > But it certainly does look promising. I had an opportunity to test re_search_article() on a similar situation--a cancelled article (see <slrn6td0r2...@ux6.cso.uiuc.edu> for details) and indeed it error()s when the article is unavailable. I'm reasonably certain re_search_article() is where your macro is stopping and the ERROR_BLOCK should work for you. > By the way, are there any archives of user-contributed S-Lang macros > out there anywhere? http://www.io.com/~pardoz/macros.html has a few slrn S-Lang macros. As far as I know, this is an opt-in archive; you won't see everything posted to Usenet included there nor are there links from there to DejaNews articles containing S-Lang macros for slrn. As far as macros for other S-Lang applications (like jed), I don't know where they are.
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: Lloyd Zusman
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
32 lines
2060 bytes
2060 bytes
blue...@ux6.cso.uiuc.edu (Dawn Owens-Nicholson) writes: > Lloyd Zusman <l...@asfast.com> wrote: > > But it certainly does look promising. > > I had an opportunity to test re_search_article() on a similar situation--a > cancelled article (see <slrn6td0r2...@ux6.cso.uiuc.edu> for > details) and indeed it error()s when the article is unavailable. I'm > reasonably certain re_search_article() is where your macro is stopping and > the ERROR_BLOCK should work for you. Well, then it looks like this is indeed the answer I've been looking for. Thanks again. > > By the way, are there any archives of user-contributed S-Lang macros > > out there anywhere? > > http://www.io.com/~pardoz/macros.html has a few slrn S-Lang macros. As far > as I know, this is an opt-in archive; you won't see everything posted to > Usenet included there nor are there links from there to DejaNews articles > containing S-Lang macros for slrn. As far as macros for other S-Lang > applications (like jed), I don't know where they are. Maybe we should start such an archive. Any thoughts about this possibility? As of this moment, the `slang.org' domain is not registered ... -- Lloyd Zusman l...@asfast.com
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: l... Lloyd Zusman
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
33 lines
1675 bytes
1675 bytes
On 16 Aug 1998 02:52:19 GMT, Dawn Owens-Nicholson <blue...@ux6.cso.uiuc.edu> wrote: > Lloyd Zusman <l...@asfast.com> wrote: > > Is there any way to modify this S-Lang macro so that it will > > automatically skip to the next article instead of aborting when this > > kind of error occurs? > > You could put an error block before the part of the function that might > fail, which looks like this line: > > > if (re_search_article (str)) > > [ ... ] > > I haven't tested this, but an ERROR_BLOCK might be what you're looking for. > > Hope this helps! Well, it at least runs successfully when there are no article-less headers. Now, all I have to do is to wait until my server serves up more of these items, and I can test this. But it certainly does look promising. Thanks! By the way, are there any archives of user-contributed S-Lang macros out there anywhere? -- Lloyd Zusman 01234567 <-- The world famous Indent-o-Meter. l...@asfast.com ^ Indent or be indented.
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: Lloyd Zusman
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
15 lines
1405 bytes
1405 bytes
a...@usa.net (Avi Schwartz) writes: > Speaking of which, I don't seem to be able find alt.lang.s-lang on any of > the news servers I checked (3 of them). Does this newsgroup even exist? Yes, it does, although it has such a low amount of traffic that many news services don't even know about it. I have had to make a request to my news admins that they start receiving it. Once I did, it showed up promptly. -- Lloyd Zusman l...@asfast.com
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: a... Avi Schwartz
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
17 lines
1440 bytes
1440 bytes
Speaking of which, I don't seem to be able find alt.lang.s-lang on any of the news servers I checked (3 of them). Does this newsgroup even exist? Avi On 16 Aug 1998 20:41:56 GMT, Dawn Owens-Nicholson <blue...@ux6.cso.uiuc.edu> wrote: >Sounds okay to me, s-lang.org might be a second choice in case slang.org is >taken soon (and "s-lang" has the side benefit of corresponding to the >spelling in the documentation and newsgroup alt.lang.s-lang). A webpage -- Windows 98 supports real multitasking - it can boot and crash simultaneously ---------------------------------------------------------------------------- Avi Schwartz to...@usa.net
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: Lloyd Zusman
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
54 lines
3254 bytes
3254 bytes
blue...@ux6.cso.uiuc.edu (Dawn Owens-Nicholson) writes: > Lloyd Zusman <l...@asfast.com> wrote: > > > > [ ... ] > > > > Maybe we should start such an archive. Any thoughts about this > > possibility? As of this moment, the `slang.org' domain is not > > registered ... > > Sounds okay to me, s-lang.org might be a second choice in case slang.org is > taken soon (and "s-lang" has the side benefit of corresponding to the > spelling in the documentation and newsgroup alt.lang.s-lang). A webpage > could be a series of pointers to DejaNews articles where the actual macros > are stored, if space is an issue. > > I don't know about the procedure to get this done, though. Anyone know what > to do? Yep. It's pretty easy. A domain registration costs $35/year, and InterNIC makes you sign up for two years initially. Once the domain is registered, all that's needed is to find an ISP that will host the site. I have a close business relationship with an ISP, and the owner owes me a lot. Therefore, I'm pretty sure that I can get a site from them for free (except for the initial $70 sign-up fee to InterNIC). As for disk space, it's not a problem if I am able to get the site at the ISP I'm thinking of. Disk space is very cheap these days, and I doubt we'd need that much, anyway. If we decide to do this, I'd be willing to pay the InterNIC sign-up fees for the domain name. I would probably register `s-lang.org' as well as `slang.org' and have them both point to the same location. I don't mind paying an extra $70 for this. And, of course, I'd gladly accept contributions after the fact from anyone who'd want to help. But before I run off and do any of this, what do you folks think about this idea? I'd hate to go to all this trouble and then find out that no one is interested, or that there's already a site like this somewhere that we just don't know about. I also would like some feedback from John Davis as to his preferences about this before we do anything. But perhaps I'll just grab `slang.org' and `s-lang.org' anyway, even if we don't end up using them right away. That way, we can be sure to have them if we ever need them. And I'd be happy to give them both to John Davis (for free) if he ever wants them in the future. -- Lloyd Zusman l...@asfast.com
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: blue... Dawn Owens-Nicholson
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
32 lines
1641 bytes
1641 bytes
Lloyd Zusman <l...@asfast.com> wrote:
> Is there any way to modify this S-Lang macro so that it will
> automatically skip to the next article instead of aborting when this
> kind of error occurs?
You could put an error block before the part of the function that might
fail, which looks like this line:
> if (re_search_article (str))
If the article isn't available when this function is called, I'm guessing
this function will error() instead of returning 0. Perhaps replacing this
line with:
ERROR_BLOCK
{
_clear_error ();
message ("Article missing!");
update ();
continue; % go to the next iteration
}
if (re_search_article (str))
(really, inserting the ERROR_BLOCK just before that line). So now when the
article isn't there and re_search_article() errors, the error is cleared and
you'll get a message.
I haven't tested this, but an ERROR_BLOCK might be what you're looking for.
Hope this helps!
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: blue... Dawn Owens-Nicholson
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
15 lines
1521 bytes
1521 bytes
Avi Schwartz <a...@usa.net> wrote: > Speaking of which, I don't seem to be able find alt.lang.s-lang on any of > the news servers I checked (3 of them). Does this newsgroup even exist? Yes, but it's not carried very widely. Supernews has it last time I looked (which was over a year ago) but my local news server doesn't carry it. DejaNews carries it, but, as the DejaNews FAQ states: In concise mode, the search results page displays the primary (first) newsgroup in the list of groups to which it was posted. So you might want to widen your search, switch to detailed mode or chase a few links to get all the articles you're interested in reading.
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: blue... Dawn Owens-Nicholson
Date: Sun, 16 Aug 1998 00:00
Date: Sun, 16 Aug 1998 00:00
20 lines
1485 bytes
1485 bytes
Lloyd Zusman <l...@asfast.com> wrote: > Well, then it looks like this is indeed the answer I've been looking for. > Thanks again. Sure. > Maybe we should start such an archive. Any thoughts about this > possibility? As of this moment, the `slang.org' domain is not > registered ... Sounds okay to me, s-lang.org might be a second choice in case slang.org is taken soon (and "s-lang" has the side benefit of corresponding to the spelling in the documentation and newsgroup alt.lang.s-lang). A webpage could be a series of pointers to DejaNews articles where the actual macros are stored, if space is an issue. I don't know about the procedure to get this done, though. Anyone know what to do?
Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.)
Author: blue... Dawn Owens-Nicholson
Date: Mon, 17 Aug 1998 00:00
Date: Mon, 17 Aug 1998 00:00
10 lines
1420 bytes
1420 bytes
John Moreno <phe...@interpath.com> wrote: > What's the purpose of the "?" [...] Taken in context, I think it's clear I was suggesting something for someone else to implement--a Usenet/e-mail mode for jed. Of course, when someone else is doing the programming, I am willing to leave the sniggly details to them. I am fully aware of what sigdashes are and that sigdashes include a trailing space.
Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.)
Author: phe... John Moreno
Date: Mon, 17 Aug 1998 00:00
Date: Mon, 17 Aug 1998 00:00
21 lines
1842 bytes
1842 bytes
In news.software.readers Dawn Owens-Nicholson wrote: > John Moreno <phe...@interpath.com> wrote: > > What's the purpose of the "?" [...] > > Taken in context, I think it's clear I was suggesting something for someone > else to implement--a Usenet/e-mail mode for jed. That I got without trouble. > Of course, when someone else is doing the programming, I am willing to > leave the sniggly details to them. I am fully aware of what sigdashes are > and that sigdashes include a trailing space. It looked to me like you were suggesting that they not use a strict interpretation of the sigdash - I think that's bad advice. -- John Moreno
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: lah... Jan Hlavacek
Date: Mon, 17 Aug 1998 00:00
Date: Mon, 17 Aug 1998 00:00
46 lines
2855 bytes
2855 bytes
On 16 Aug 1998 07:12:44 GMT, Dawn Owens-Nicholson
<blue...@ux6.cso.uiuc.edu> wrote:
> Lloyd Zusman <l...@asfast.com> wrote:
> > But it certainly does look promising.
>
> I had an opportunity to test re_search_article() on a similar situation--a
> cancelled article (see <slrn6td0r2...@ux6.cso.uiuc.edu> for
> details) and indeed it error()s when the article is unavailable. I'm
> reasonably certain re_search_article() is where your macro is stopping and
> the ERROR_BLOCK should work for you.
>
> > By the way, are there any archives of user-contributed S-Lang macros
> > out there anywhere?
>
> http://www.io.com/~pardoz/macros.html has a few slrn S-Lang macros. As far
> as I know, this is an opt-in archive; you won't see everything posted to
> Usenet included there nor are there links from there to DejaNews articles
> containing S-Lang macros for slrn. As far as macros for other S-Lang
> applications (like jed), I don't know where they are.
Most of the macros for jed are in jed's distribution. Slrn and jed are
probably the two most commonly used s-lang applications out there.
Slang interpreter for mutt is very new, not even part of the
distribution. I'm slowly working on slang interpreter for slsc.
Recently I didn't have time to even look at it, but it is on top of my
to-do list.
I started a little archive of s-lang code as a part of my s-lang page:
http://www.math.ohio-state.edu/%7Elahvak/slang/
One example for slrn saves all unread articles from a newsgroup, and it
uses ERRORBLOCK in similar way as described in earlier posts to solve
the problem of unavailable articles.
I would like to add more macros, so if you know about something which
you would like to see there, let me know.
Thanks,
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/
Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.)
Author: blue... Dawn Owens-Nicholson
Date: Mon, 17 Aug 1998 00:00
Date: Mon, 17 Aug 1998 00:00
22 lines
2158 bytes
2158 bytes
obscurity <obsc...@obscure.org> wrote: > [I started writing a newsreader in slang, so I could run it from within Jed > (I *really* like the emacs/gnus model), But do you like it enough to justify rewriting all the code that has gone into slrn? If so, why? I'm genuinely curious about this; I don't see what the significant advantages are to making a newsreader for jed versus using jed to edit articles and slrn for newsreading. I think it would be a far more productive use of your time to work on a Usenet/e-mail mode for jed so quoting is handled appropriately when reformatting paragraphs (this has already been written, but could be included in such a mode, if the author permits), doesn't word wrap when editing headers but does word wrap when editing unquoted paragraphs, wraps in a way that preserves quoting when editing quoted lines and doesn't truncate the trailing space on the sigdash line (defining the sigdash line as the line closest to the bottom that matches "^-- ?$"). [I could switch to emacs, which I believe can do much, if not all, of this, but I've been editing S-Lang code for a while now and jed is the best editor I've seen to do that. I don't want to learn multiple editors if I can avoid it.]
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: obsc... obscurity
Date: Mon, 17 Aug 1998 00:00
Date: Mon, 17 Aug 1998 00:00
27 lines
2260 bytes
2260 bytes
On 16 Aug 1998 20:00:05 -0400, Lloyd Zusman <l...@asfast.com> wrote: [about a web-based archive of slang macros] > But before I run off and do any of this, what do you folks think about > this idea? I'd hate to go to all this trouble and then find out that > no one is interested, or that there's already a site like this > somewhere that we just don't know about. I've recently been leaning more towards python as my embedded-language-of -choice, largely because of the apparent lack of any kind of community/resources for slang. I think that anything that helps to improve this situation can only be a Good Thing, and would be happy to give what little help I can. [I started writing a newsreader in slang, so I could run it from within Jed (I *really* like the emacs/gnus model), but it turned out to be too inefficient. I'm thinking of redesigning it so that a stand-alone executable (written in C) is called to do all the threading etc., and returns the article summary on stdout so it can be captured into a Jed buffer. Anyone else interested in such a project, or should I save my time ?] -- obscurity. "Only the great masters of style ever succeed in being obscure." - Oscar Wilde
Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.)
Author: phe... John Moreno
Date: Mon, 17 Aug 1998 00:00
Date: Mon, 17 Aug 1998 00:00
13 lines
1467 bytes
1467 bytes
In news.software.readers Dawn Owens-Nicholson <blue...@ux6.cso.uiuc.edu> wrote: > as the line closest to the bottom that matches "^-- ?$"). [I could switch to What's the purpose of the "?" - the sigdsash includes a space, are you thinking of checking for it without? I don't think that's a good idea, a couple three dashes are often used as tear lines. -- John Moreno
Re: Scoring with S-Lang function (Was: Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.))
Author: Lloyd Zusman
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
812 lines
22446 bytes
22446 bytes
Speaking of scoring with an S-Lang function, here's the thing I wrote
last year to aid in converting a standard slrn score file to some
S-Lang code which does the same thing. Once you run your score file
through this Perl script, you can dispense with the score file
altogether and use the resulting S-Lang code, instead. The full
complement of S-Lang features will then be available to you for doing
any kind of scoring you like.
This post contains the Perl script itsef, called "scoregen", and the
other post in this series contains the associated README file. Please
read the README file completely before attempting to make use of
"scoregen".
All feedback is welcome.
Lloyd Zusman
l...@asfast.com
--------------------------- "scoregen" script ---------------------------
#!/usr/bin/perl
# -*- perl -*-
# This routine generates some S-Lang routines which do the same thing
# as specified in an Slrn score file.
#
# This routine must be run under Perl version 5.000 or later.
#
# Here's how to invoke it:
#
# scoregen [ Slrn-score-file [ S-Lang-output-file ] ]
#
# If S-Lang-output-file is missing, output goes to STDOUT.
# If Slrn-score-file is missing, input comes from STDIN.
#
#
# Version 0.04 -- August 12, 1998, Lloyd Zusman <l...@asfast.com>
# Fixed a bug in handling tabs in the input file.
# Now works properly when specified groups have no scoring rules.
#
# Version 0.03 -- October 19, 1997, Lloyd Zusman <l...@asfast.com>
# Changed format of these revision comments.
# Got rid of string_match_nocase(); now using \\C in pattern_match().
# Added call to do_scoring() governed by doScoring variable.
# Propagate comments from score file into generated code.
#
# Version 0.02 -- October 17, 1997, Lloyd Zusman <l...@asfast.com>
# Fixed bug in keyword matching.
# Treats initial missing newsgroups as all newsgroups.
# Put andelse/orelse processing in newsgroup matches.
#
# Version 0.01 -- October 17, 1997, Lloyd Zusman <l...@asfast.com>
# Initial version.
# This sets '$program' to the base name of argv0.
($program = $0) =~ s|^.*/||;
# Get the command-line arguments and process them.
$infile = shift(@ARGV);
$outfile = shift(@ARGV);
unless (defined($infile)) {
$inName = 'STDIN';
$outName = '';
$originalScoreFile = "that was piped in via $inName";
open(IN, "<&STDIN");
open(OUT, ">&STDOUT");
}
else {
unless (open(IN, "<$infile")) {
die "$program: unable to open input file: $infile\n";
}
$inName = $infile;
$originalScoreFile = "'$inName'";
if (defined($outfile)) {
unless (open(OUT, ">$outfile")) {
close(IN);
die "$program: unable to open output file: $outfile\n";
}
$outName = $outfile;
}
else {
open(OUT, ">&STDOUT");
undef($finalMessage);
$outName = '';
}
}
# Read all the input into the @inputLines array (change this to
# one-line-at-a-time-processing if you're short on virtual memory
# and are processing a very large score file).
@inputLines = <IN>;
close(IN);
# Initialize some variables.
undef($currentGroups);
undef(@currentGroupList);
undef($inGroup);
undef($currentScore);
undef($currentExpires);
undef(@currentComments);
undef(@groupComments);
undef(@expiresComments);
undef(@scoreComments);
undef($out);
undef($orType);
undef(@headerInfo);
undef(%headerVar);
# Process the input.
$allGroupsFlag = ']['; # special code for all groups
$currentGroups = $allGroupsFlag;
@currentGroupList = ( $currentGroups );
foreach $inLine (@inputLines) {
($line = $inLine) =~ s|\s+$||;
# Skip comment lines as per (almost) the same rule in score.c.
# I say "almost" because I don't trash tabs.
if ($line =~ m|^\s*[%#\000-\010\012-\037]|) {
push(@currentComments, $line);
next;
}
# A newsgroup line?
if ($line =~ m|^\s*\[(\s*~)?\s*([^\[\]]*)\]\s*$|) {
# We found a [ group ... ] line.
$negation = $1;
$groups = $2;
@groupComments = @currentComments;
undef(@currentComments);
scoreProcessing();
($currentGroups = $groups) =~ s|\s||g;
@currentGroupList = split(/,/, $currentGroups);
# Start processing this new set of group information.
undef($currentScore);
undef($currentExpires);
undef($orType);
undef(@headerInfo);
}
else {
# We found a potential score set.
if ($line =~ m|^(.+?):(:)?([^:].*)$|) {
$item = $1;
$extraColon = $2;
$value = $3;
$item =~ s|\s||g;
$value =~ s|^\s*(.*$)\s*$|$1|;
if ($item =~ m|^score$|i) {
# This is a Score: or a Score:: line
scoreProcessing();
undef($currentExpires);
undef(@headerInfo);
$orType = ($extraColon eq ':');
$currentScore = $value;
@scoreComments = @currentComments;
undef(@currentComments);
}
elsif ($item =~ m|^expires$|i) {
# This is an Expires: line
$currentExpires = $value;
@expiresComments = @currentComments;
undef(@currentComments);
}
else {
# This is a header matching line.
if ($item =~ m|^(~)(.*)$|) {
$separator = $1;
$itemToken = $2;
}
else {
$separator = ':'; # use ':' as a flag when no negation
$itemToken = $item;
}
# Store the header info.
my $itemToken = ucfirst(lc($itemToken));
my $commentString = join("\n", @currentComments);
undef(@currentComments);
my $headerStuff =
"\001$commentString\001$itemToken$separator$value";
push(@headerInfo, $headerStuff);
$headerVar{$itemToken} = $itemToken;
}
}
}
}
# We've processed all the lines from the original score file. Now,
# process the final score set and finish processing the final group
# information.
scoreProcessing();
if ($inGroup) {
endGroupProcessing();
}
# The '$out' variable now contains the generated S-Lang logic. Write
# it out after some initialization stuff, and then finish off with
# some termination code.
print OUT initialization();
print OUT $out;
print OUT termination();
close(OUT);
# OK. We're done.
if ($outName ne '') {
print "Success: $inName -> $outName\n";
}
exit(0);
# This routine outputs the stuff that goes at the head of the set
# of generated S-Lang routines.
sub initialization {
my $key = '';
my $result = '';
my $first = "\n";
my $now = dateTime();
$result .= <<EOD;
% -*- mode: slang; mode: fold -*-
%
% Automatically generated on $now.
%
% This file consists of S-Lang code that was generated from
% the Slrn score file $originalScoreFile.
%
% The original score file contents now appear at the bottom
% of this generated file, commented out.
%
% Routines: convenience functions -- See below.
% score_article() -- Scores each individual article.
% Called repeatedly by do_scoring().
% do_scoring() -- Scores all your articles.
EOD
# This retrieves the convenience functions which are defined after
# the __END__ line, below.
$result .= join('', <DATA>);
$result .= <<EOD;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This routine was generated from the original score file. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This routine is meant to be called once for each article, and
% it does the actual scoring. This is the routine that was
% generated from your original score file, and it's what you
% should be modifying if you want to alter your scoring algorithm.
define score_article ( newsgroup, today )
{
% Note that this routine makes use of 'andelse', 'orelse',
% and other constructs that might be confusing if you aren't
% familiar with S-Lang. I did this for two reasons: (1) to
% ensure that this routine runs as efficiently as possible,
% and (2) to make it comparatively easy for me to write the
% Perl program which automatically generates this code.
%
% Feel free to replace these constructs with those of your
% choosing when you begin to manually alter the scoring
% algorithms that have been generated for you in this routine.
variable score = get_header_score();
variable originalScore = score;
EOD
foreach $key (sort keys %headerVar) {
my $firstPart = sprintf("$first variable header%-10s", $key);
if ($key =~ m|^lines$|i) {
$result .= "$firstPart = " .
"integer( extract_article_header( \"$key\" ) );\n";
}
else {
$result .= "$firstPart = " .
"extract_article_header( \"$key\" );\n";
}
$first = '';
}
unless ($first) {
$result .= "\n";
}
return ($result);
}
# This routine outputs the stuff that needs to be written after
# all the S-Lang code has been generated.
sub termination {
my $result = '';
my $comment;
if (scalar(@currentComments) > 0) {
foreach $comment (@currentComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$result .= " $comment\n";
}
$result .= "\n";
undef(@currentComments);
}
$result .= " if ( score != originalScore )\n";
$result .= " {\n";
$result .= " set_header_score( score );\n";
$result .= " }\n";
$result .= "}\n";
$result .= <<EOD;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of generated routine. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Routine for invoking score_article(). %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Either ...
%
% (1) ... invoke this routine from within article_mode_hook, or
% (2) ... insert this routine's logic into article_mode_hook, or
% (3) ... rename this routine as 'article_mode_hook'.
% define article_mode_hook ()
define do_scoring ()
{
call( "header_bob" );
uncollapse_threads();
% Initialize these variables here and repeatedly pass them into
% score_article(). This ensures that current_newsgroup() and
% get_today() will each be called only once per newsgroup.
variable newsgroup = current_newsgroup();
variable today = get_today();
do
{
score_article( newsgroup, today );
} while ( header_down( 1 ) );
collapse_threads();
call( "header_bob" );
}
% If 'doScoring' is set as a global variable, automatically invoke
% the do_scoring() routine. This allows you to conditionally use
% evalfile() on this generated score file to do your scoring.
if (doScoring) {
do_scoring();
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of routine for invoking score_article(). %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Original contents of score file begin here. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
EOD
foreach $line (@inputLines) {
$result .= "%% $line";
}
$result .= <<EOD;
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of original contents of score file. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EOD
return ($result);
}
# This routine begins the processing of a new group line.
sub startGroupProcessing {
if ($inGroup) {
endGroupProcessing();
}
if ($currentGroups =~ m|^\s*$|) {
return;
}
my $negation = shift;
my $if = 'if';
my $group;
my $operator;
my $separator;
my $comment;
if (scalar(@groupComments) > 0) {
foreach $comment (@groupComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$out .= " $comment\n";
}
undef(@groupComments);
}
$out .= "\n ";
if ($negation) {
$out .= '!';
}
$out .= 'if ( ';
if ($currentGroups eq $allGroupsFlag) {
$out .= "1";
$comment = ' % special case for all newsgroups';
}
else {
$out .= "orelse";
foreach $group (@currentGroupList) {
$out .= "\n { pattern_match( newsgroup, \"$group\" ) }";
}
$comment = '';
}
$out .= " )$comment\n";
$out .= " {\n";
$out .= " % The following 'loop' construct makes it easier to\n";
$out .= " % automatically generate the code for managing the\n";
$out .= " % \"Expires:\" tag and for handling the case for\n";
$out .= " % score = 9999 and -9999. Feel free to modify this\n";
$out .= " % somewhat awkward syntax.\n\n";
$out .= " loop ( 1 )\n";
$out .= " {";
$inGroup = 1;
undef($currentGroups);
undef(@currentGroupList);
}
# This routine ends the processing of group information.
sub endGroupProcessing {
$out .= "\n break;\n";
$out .= " }\n";
$out .= " }\n\n";
undef($inGroup);
}
# This routine generates all the scoring logic.
sub scoreProcessing {
unless ($currentGroups =~ m|^\s*$|) {
startGroupProcessing();
}
my ($first, $key, $thing, $value, $sep, $op, $neg, $boolean,
$comment);
$first = "\n";
unless ($currentExpires =~ m|^\s*$|) {
if (scalar(@expiresComments) > 0) {
my $comment;
foreach $comment (@expiresComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$out .= "$first $comment\n";
$first = '';
}
undef(@expiresComments);
}
$out .= "$first if ( today >= date_value( \"$currentExpires\" ) )\n";
$out .= " {\n";
$out .= " break;\n";
$out .= " }\n";
}
if ($currentScore =~ m|^\s*$|) {
return;
}
if (scalar(@scoreComments) > 0) {
foreach $comment (@scoreComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$out .= "\n $comment";
}
undef(@scoreComments);
}
if (scalar(@headerInfo) < 1) {
$sep = "\n";
}
else {
$sep = ' ';
if ($orType) {
$boolean = 'orelse';
}
else {
$boolean = 'andelse';
}
$out .= "\n if ( $boolean";
foreach $thing (@headerInfo) {
unless ($thing =~ m#^\001(.*?)\001(.*?)([~:])(.*)$#s) {
next;
}
$comment = $1;
$key = $2;
$neg = $3;
$value = $4;
unless ($comment =~ m|^\s*$|) {
my $c;
foreach $c (split(/\n/, $comment)) {
$c =~ s|^[^%#\000-\010\012-\037]+||;
$out .= "\n $c";
}
}
if ($neg eq '~') {
$op = '>=';
$neg = ' not (';
$end = ') ';
}
else {
$op = '<';
$neg = '';
$end = '';
}
$out .= "\n {";
if ($key =~ m|^lines$|i) {
$out .= " ( header$key $op $value ) }";
}
else {
$value =~ s|\\|\\\\|g;
$out .= "$neg string_match( header$key, \"$value\", 1 ) $end}";
}
}
$out .= " )\n {\n";
}
$currentScore =~ m|^\s*(=)?\s*(\S.*)\s*?$|;
my $operator = $1;
my $score = $2;
$score =~ s|[\+\s]||g;
if ($score <= -9999 || $score >= 9999) {
$out .= "$sep score = $score;\n";
$out .= "$sep break;\n";
}
else {
if ($operator eq '') {
if ($score < 0) {
$score = -$score;
$operator = '-=';
}
else {
$operator = '+=';
}
}
$out .= "$sep score $operator $score;\n";
}
unless ($sep =~ m|^\n|) {
$out .= " }\n";
}
}
sub dateTime {
my ($now) = shift;
$now += 0;
if ($now < 1) {
$now = time();
}
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($now);
return (sprintf("%04d/%02d/%02d at %02d:%02d:%02d",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
}
# In Perl, everything after an __END__ line is ignored by the
# interpreter, and it's readable as data via the DATA file handle.
# I make use of this to store the S-Lang code for the convenience
# functions that I'm including with the code that gets generated.
# Look in the 'initialization' routine, above, to see how I access
# this information.
__END__
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% These are the convenience functions that are used below. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function converts a newsgroup pattern into a proper regexp.
% It does this in the same manner as the slrn_fix_regexp()
% function in util.c. Therefore, this routine is a good candidate
% for replacement by a new intrinsic.
define fix_regexp ( pattern )
{
variable len = strlen( pattern );
variable regexp = "^";
variable i;
for ( i = 0; i < len; i++ )
{
if ( pattern[i] == '.' )
{
regexp = strcat( regexp, "\\" );
}
else if ( pattern[i] == '*' )
{
regexp = strcat(regexp, ".");
}
regexp = strcat( regexp, substr( pattern, i + 1, 1 ) );
}
regexp = strcat( regexp, "$" );
return ( regexp );
}
% Return today's date in a form usable in date comparisons. The
% value returned is in the same form as that which is returned by
% the get_today() function in score.c, and therefore, this routine
% is another good candidate for replacement by a new intrinsic.
define get_today ()
{
variable now = time();
variable month = extract_element( now, 1, " " );
variable day = extract_element( now, 2, " " );
variable year = extract_element( now, 4, " " );
if ( orelse
{ strlen( month ) < 1 }
{ strlen( day ) < 1 }
{ strlen( year ) < 1 } )
{
% Error!
return ( -1 );
}
variable match =
string_match( "JanFebMarAprMayJunJulAugSepOctNovDec", month, 1 );
if ( match < 1 )
{
% Error!
return (-1);
}
year = integer( year );
month = ( match - 1 ) / 3;
day = integer( day );
return ( ( year * 10000 ) + ( month * 100 ) + day );
}
% Convert a date into an integer form that is useful for comparisons
% (but not useful for date arithmetic). The value returned will be
% in the same form as that which is used by the get_today() and the
% has_score_expired() functions in score.c.
define date_value ( date )
{
variable month = extract_element( date, 0, "/" );
variable day = extract_element( date, 1, "/" );
variable year = extract_element( date, 2, "/" );
if ( orelse
{ strlen( month ) < 1 }
{ strlen( day ) < 1 }
{ strlen( year ) < 1 } )
{
month = extract_element( date, 0, "-" );
day = extract_element( date, 1, "-" );
year = extract_element( date, 2, "-" );
if ( orelse
{ strlen( month ) < 1 }
{ strlen( day ) < 1 }
{ strlen( year ) < 1 } )
{
% Error!
return ( -1 );
}
}
year = integer( year );
month = integer( month );
day = integer( day );
if ( orelse
{ year < 1900 }
{ month < 1 }
{ month > 12 }
{ day < 1 }
{ day > 31 } )
{
% Error!
return ( -1 );
}
return ( ( year * 10000 ) + ( ( month - 1 ) * 100 ) + day );
}
% This routine does a newsgroup pattern match. It's used
% within score_article() to match newsgroups. It also could
% be used there to do this same kind of pattern matching on
% the "Newsgroups:" line during scoring.
define pattern_match ( group, pattern )
{
return ( string_match( group, fix_regexp( strcat( "\\C", pattern ) ), 1 ) );
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of convenience functions. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Re: Scoring with S-Lang function (Was: Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.))
Author: Lloyd Zusman
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
813 lines
22285 bytes
22285 bytes
I'm sorry, but I posted a buggy version of "scorgen" earlier tonight.
The one I'm posting here has been fixed. It seems to work OK under
slrn 0.9.5.2.
Lloyd Zusman
l...@asfast.com
--------------------------- "scoregen" script ---------------------------
#!/usr/bin/perl
# -*- perl -*-
# This routine generates some S-Lang routines which do the same thing
# as specified in an Slrn score file.
#
# This routine must be run under Perl version 5.000 or later.
#
# Here's how to invoke it:
#
# scoregen [ Slrn-score-file [ S-Lang-output-file ] ]
#
# If S-Lang-output-file is missing, output goes to STDOUT.
# If Slrn-score-file is missing, input comes from STDIN.
#
#
# Version 0.05 -- August 18, 1998, Lloyd Zusman <l...@asfast.com>
# Fixed "opposite sense" bug in Lines comparison.
# Replaced final argument of extract_element() with an integer.
# Default to case insensitivity in string matches.
#
# Version 0.04 -- August 12, 1998, Lloyd Zusman <l...@asfast.com>
# Fixed a bug in handling tabs in the input file.
# Now works properly when specified groups have no scoring rules.
#
# Version 0.03 -- October 19, 1997, Lloyd Zusman <l...@asfast.com>
# Changed format of these revision comments.
# Got rid of string_match_nocase(); now using \\C in pattern_match().
# Added call to do_scoring() governed by doScoring variable.
# Propagate comments from score file into generated code.
#
# Version 0.02 -- October 17, 1997, Lloyd Zusman <l...@asfast.com>
# Fixed bug in keyword matching.
# Treats initial missing newsgroups as all newsgroups.
# Put andelse/orelse processing in newsgroup matches.
#
# Version 0.01 -- October 17, 1997, Lloyd Zusman <l...@asfast.com>
# Initial version.
# This sets '$program' to the base name of argv0.
($program = $0) =~ s|^.*/||;
# Get the command-line arguments and process them.
$infile = shift(@ARGV);
$outfile = shift(@ARGV);
unless (defined($infile)) {
$inName = 'STDIN';
$outName = '';
$originalScoreFile = "that was piped in via $inName";
open(IN, "<&STDIN");
open(OUT, ">&STDOUT");
}
else {
unless (open(IN, "<$infile")) {
die "$program: unable to open input file: $infile\n";
}
$inName = $infile;
$originalScoreFile = "'$inName'";
if (defined($outfile)) {
unless (open(OUT, ">$outfile")) {
close(IN);
die "$program: unable to open output file: $outfile\n";
}
$outName = $outfile;
}
else {
open(OUT, ">&STDOUT");
undef($finalMessage);
$outName = '';
}
}
# Read all the input into the @inputLines array (change this to
# one-line-at-a-time-processing if you're short on virtual memory
# and are processing a very large score file).
@inputLines = <IN>;
close(IN);
# Initialize some variables.
undef($currentGroups);
undef(@currentGroupList);
undef($inGroup);
undef($currentScore);
undef($currentExpires);
undef(@currentComments);
undef(@groupComments);
undef(@expiresComments);
undef(@scoreComments);
undef($out);
undef($orType);
undef(@headerInfo);
undef(%headerVar);
# Process the input.
$allGroupsFlag = ']['; # special code for all groups
$currentGroups = $allGroupsFlag;
@currentGroupList = ( $currentGroups );
foreach $inLine (@inputLines) {
($line = $inLine) =~ s|\s+$||;
# Skip comment lines as per (almost) the same rule in score.c.
# I say "almost" because I don't trash tabs.
if ($line =~ m|^\s*[%#\000-\010\012-\037]|) {
push(@currentComments, $line);
next;
}
# A newsgroup line?
if ($line =~ m|^\s*\[(\s*~)?\s*([^\[\]]*)\]\s*$|) {
# We found a [ group ... ] line.
$negation = $1;
$groups = $2;
@groupComments = @currentComments;
undef(@currentComments);
scoreProcessing();
($currentGroups = $groups) =~ s|\s||g;
@currentGroupList = split(/,/, $currentGroups);
# Start processing this new set of group information.
undef($currentScore);
undef($currentExpires);
undef($orType);
undef(@headerInfo);
}
else {
# We found a potential score set.
if ($line =~ m|^(.+?):(:)?([^:].*)$|) {
$item = $1;
$extraColon = $2;
$value = $3;
$item =~ s|\s||g;
$value =~ s|^\s*(.*$)\s*$|$1|;
if ($item =~ m|^score$|i) {
# This is a Score: or a Score:: line
scoreProcessing();
undef($currentExpires);
undef(@headerInfo);
$orType = ($extraColon eq ':');
$currentScore = $value;
@scoreComments = @currentComments;
undef(@currentComments);
}
elsif ($item =~ m|^expires$|i) {
# This is an Expires: line
$currentExpires = $value;
@expiresComments = @currentComments;
undef(@currentComments);
}
else {
# This is a header matching line.
if ($item =~ m|^(~)(.*)$|) {
$separator = $1;
$itemToken = $2;
}
else {
$separator = ':'; # use ':' as a flag when no negation
$itemToken = $item;
}
# Store the header info.
my $itemToken = ucfirst(lc($itemToken));
my $commentString = join("\n", @currentComments);
undef(@currentComments);
my $headerStuff =
"\001$commentString\001$itemToken$separator$value";
push(@headerInfo, $headerStuff);
$headerVar{$itemToken} = $itemToken;
}
}
}
}
# We've processed all the lines from the original score file. Now,
# process the final score set and finish processing the final group
# information.
scoreProcessing();
if ($inGroup) {
endGroupProcessing();
}
# The '$out' variable now contains the generated S-Lang logic. Write
# it out after some initialization stuff, and then finish off with
# some termination code.
print OUT initialization();
print OUT $out;
print OUT termination();
close(OUT);
# OK. We're done.
if ($outName ne '') {
print "Success: $inName -> $outName\n";
}
exit(0);
# This routine outputs the stuff that goes at the head of the set
# of generated S-Lang routines.
sub initialization {
my $key = '';
my $result = '';
my $first = "\n";
my $now = dateTime();
$result .= <<EOD;
% -*- mode: slang; mode: fold -*-
%
% Automatically generated on $now.
%
% This file consists of S-Lang code that was generated from
% the Slrn score file $originalScoreFile.
%
% The original score file contents now appear at the bottom
% of this generated file, commented out.
%
% Routines: convenience functions -- See below.
% score_article() -- Scores each individual article.
% Called repeatedly by do_scoring().
% do_scoring() -- Scores all your articles.
EOD
# This retrieves the convenience functions which are defined after
# the __END__ line, below.
$result .= join('', <DATA>);
$result .= <<EOD;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This routine was generated from the original score file. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This routine is meant to be called once for each article, and
% it does the actual scoring. This is the routine that was
% generated from your original score file, and it's what you
% should be modifying if you want to alter your scoring algorithm.
define score_article ( newsgroup, today )
{
% Note that this routine makes use of 'andelse', 'orelse',
% and other constructs that might be confusing if you aren't
% familiar with S-Lang. I did this for two reasons: (1) to
% ensure that this routine runs as efficiently as possible,
% and (2) to make it comparatively easy for me to write the
% Perl program which automatically generates this code.
%
% Feel free to replace these constructs with those of your
% choosing when you begin to manually alter the scoring
% algorithms that have been generated for you in this routine.
variable score = get_header_score();
variable originalScore = score;
EOD
foreach $key (sort keys %headerVar) {
my $firstPart = sprintf("$first variable header%-10s", $key);
if ($key =~ m|^lines$|i) {
$result .= "$firstPart = " .
"integer( extract_article_header( \"$key\" ) );\n";
}
else {
$result .= "$firstPart = " .
"extract_article_header( \"$key\" );\n";
}
$first = '';
}
unless ($first) {
$result .= "\n";
}
return ($result);
}
# This routine outputs the stuff that needs to be written after
# all the S-Lang code has been generated.
sub termination {
my $result = '';
my $comment;
if (scalar(@currentComments) > 0) {
foreach $comment (@currentComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$result .= " $comment\n";
}
$result .= "\n";
undef(@currentComments);
}
$result .= " if ( score != originalScore )\n";
$result .= " {\n";
$result .= " set_header_score( score );\n";
$result .= " }\n";
$result .= "}\n";
$result .= <<EOD;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of generated routine. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Routine for invoking score_article(). %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Either ...
%
% (1) ... invoke this routine from within article_mode_hook, or
% (2) ... insert this routine's logic into article_mode_hook, or
% (3) ... rename this routine as 'article_mode_hook'.
% define article_mode_hook ()
define do_scoring ()
{
call( "header_bob" );
uncollapse_threads();
% Initialize these variables here and repeatedly pass them into
% score_article(). This ensures that current_newsgroup() and
% get_today() will each be called only once per newsgroup.
variable newsgroup = current_newsgroup();
variable today = get_today();
do
{
score_article( newsgroup, today );
} while ( header_down( 1 ) );
collapse_threads();
call( "header_bob" );
}
% If 'doScoring' is set as a global variable, automatically invoke
% the do_scoring() routine. This allows you to conditionally use
% evalfile() on this generated score file to do your scoring.
if (doScoring) {
do_scoring();
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of routine for invoking score_article(). %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Original contents of score file begin here. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
EOD
foreach $line (@inputLines) {
$result .= "%% $line";
}
$result .= <<EOD;
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of original contents of score file. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EOD
return ($result);
}
# This routine begins the processing of a new group line.
sub startGroupProcessing {
if ($inGroup) {
endGroupProcessing();
}
if ($currentGroups =~ m|^\s*$|) {
return;
}
my $negation = shift;
my $if = 'if';
my $group;
my $operator;
my $separator;
my $comment;
if (scalar(@groupComments) > 0) {
foreach $comment (@groupComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$out .= " $comment\n";
}
undef(@groupComments);
}
$out .= "\n ";
if ($negation) {
$out .= '!';
}
$out .= 'if ( ';
if ($currentGroups eq $allGroupsFlag) {
$out .= "1";
$comment = ' % special case for all newsgroups';
}
else {
$out .= "orelse";
foreach $group (@currentGroupList) {
$out .= "\n { pattern_match( newsgroup, \"$group\" ) }";
}
$comment = '';
}
$out .= " )$comment\n";
$out .= " {\n";
$out .= " % The following 'loop' construct makes it easier to\n";
$out .= " % automatically generate the code for managing the\n";
$out .= " % \"Expires:\" tag and for handling the case for\n";
$out .= " % score = 9999 and -9999. Feel free to modify this\n";
$out .= " % somewhat awkward syntax.\n\n";
$out .= " loop ( 1 )\n";
$out .= " {";
$inGroup = 1;
undef($currentGroups);
undef(@currentGroupList);
}
# This routine ends the processing of group information.
sub endGroupProcessing {
$out .= "\n break;\n";
$out .= " }\n";
$out .= " }\n\n";
undef($inGroup);
}
# This routine generates all the scoring logic.
sub scoreProcessing {
unless ($currentGroups =~ m|^\s*$|) {
startGroupProcessing();
}
my ($first, $key, $thing, $value, $sep, $op, $neg, $boolean,
$comment);
$first = "\n";
unless ($currentExpires =~ m|^\s*$|) {
if (scalar(@expiresComments) > 0) {
my $comment;
foreach $comment (@expiresComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$out .= "$first $comment\n";
$first = '';
}
undef(@expiresComments);
}
$out .= "$first if ( today >= date_value( \"$currentExpires\" ) )\n";
$out .= " {\n";
$out .= " break;\n";
$out .= " }\n";
}
if ($currentScore =~ m|^\s*$|) {
return;
}
if (scalar(@scoreComments) > 0) {
foreach $comment (@scoreComments) {
$comment =~ s|^[^%#\000-\010\012-\037]+||;
$out .= "\n $comment";
}
undef(@scoreComments);
}
if (scalar(@headerInfo) < 1) {
$sep = "\n";
}
else {
$sep = ' ';
if ($orType) {
$boolean = 'orelse';
}
else {
$boolean = 'andelse';
}
$out .= "\n if ( $boolean";
foreach $thing (@headerInfo) {
unless ($thing =~ m#^\001(.*?)\001(.*?)([~:])(.*)$#s) {
next;
}
$comment = $1;
$key = $2;
$neg = $3;
$value = $4;
unless ($comment =~ m|^\s*$|) {
my $c;
foreach $c (split(/\n/, $comment)) {
$c =~ s|^[^%#\000-\010\012-\037]+||;
$out .= "\n $c";
}
}
if ($neg eq '~') {
$op = '<';
$neg = ' not (';
$end = ') ';
}
else {
$op = '>=';
$neg = '';
$end = '';
}
$out .= "\n {";
if ($key =~ m|^lines$|i) {
$out .= " ( header$key $op $value ) }";
}
else {
$value =~ s|\\|\\\\|g;
if ($value =~ m/^\^(.*)$/) {
$value = "^\\\\C$1";
}
else {
$value = "\\\\C$value";
}
$out .= "$neg string_match( header$key, \"$value\", 1 ) $end}";
}
}
$out .= " )\n {\n";
}
$currentScore =~ m|^\s*(=)?\s*(\S.*)\s*?$|;
my $operator = $1;
my $score = $2;
$score =~ s|[\+\s]||g;
if ($score <= -9999 || $score >= 9999) {
$out .= "$sep score = $score;\n";
$out .= "$sep break;\n";
}
else {
if ($operator eq '') {
if ($score < 0) {
$score = -$score;
$operator = '-=';
}
else {
$operator = '+=';
}
}
$out .= "$sep score $operator $score;\n";
}
unless ($sep =~ m|^\n|) {
$out .= " }\n";
}
}
sub dateTime {
my ($now) = shift;
$now += 0;
if ($now < 1) {
$now = time();
}
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($now);
return (sprintf("%04d/%02d/%02d at %02d:%02d:%02d",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
}
# In Perl, everything after an __END__ line is ignored by the
# interpreter, and it's readable as data via the DATA file handle.
# I make use of this to store the S-Lang code for the convenience
# functions that I'm including with the code that gets generated.
# Look in the 'initialization' routine, above, to see how I access
# this information.
__END__
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% These are the convenience functions that are used below. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function converts a newsgroup pattern into a proper regexp.
% It does this in the same manner as the slrn_fix_regexp()
% function in util.c. Therefore, this routine is a good candidate
% for replacement by a new intrinsic.
define fix_regexp ( pattern )
{
variable len = strlen( pattern );
variable regexp = "^";
variable i;
for ( i = 0; i < len; i++ )
{
if ( pattern[i] == '.' )
{
regexp = strcat( regexp, "\\" );
}
else if ( pattern[i] == '*' )
{
regexp = strcat(regexp, ".");
}
regexp = strcat( regexp, substr( pattern, i + 1, 1 ) );
}
regexp = strcat( regexp, "$" );
return ( regexp );
}
% Return today's date in a form usable in date comparisons. The
% value returned is in the same form as that which is returned by
% the get_today() function in score.c, and therefore, this routine
% is another good candidate for replacement by a new intrinsic.
define get_today ()
{
variable now = time();
variable month = extract_element( now, 1, ' ' );
variable day = extract_element( now, 2, ' ' );
variable year = extract_element( now, 4, ' ' );
if ( orelse
{ strlen( month ) < 1 }
{ strlen( day ) < 1 }
{ strlen( year ) < 1 } )
{
% Error!
return ( -1 );
}
variable match =
string_match( "JanFebMarAprMayJunJulAugSepOctNovDec", month, 1 );
if ( match < 1 )
{
% Error!
return (-1);
}
year = integer( year );
month = ( match - 1 ) / 3;
day = integer( day );
return ( ( year * 10000 ) + ( month * 100 ) + day );
}
% Convert a date into an integer form that is useful for comparisons
% (but not useful for date arithmetic). The value returned will be
% in the same form as that which is used by the get_today() and the
% has_score_expired() functions in score.c.
define date_value ( date )
{
variable month = extract_element( date, 0, '/' );
variable day = extract_element( date, 1, '/' );
variable year = extract_element( date, 2, '/' );
if ( orelse
{ strlen( month ) < 1 }
{ strlen( day ) < 1 }
{ strlen( year ) < 1 } )
{
month = extract_element( date, 0, '-' );
day = extract_element( date, 1, '-' );
year = extract_element( date, 2, '-' );
if ( orelse
{ strlen( month ) < 1 }
{ strlen( day ) < 1 }
{ strlen( year ) < 1 } )
{
% Error!
return ( -1 );
}
}
year = integer( year );
month = integer( month );
day = integer( day );
if ( orelse
{ year < 1900 }
{ month < 1 }
{ month > 12 }
{ day < 1 }
{ day > 31 } )
{
% Error!
return ( -1 );
}
return ( ( year * 10000 ) + ( ( month - 1 ) * 100 ) + day );
}
% This routine does a newsgroup pattern match. It's used
% within score_article() to match newsgroups. It also could
% be used there to do this same kind of pattern matching on
% the "Newsgroups:" line during scoring.
define pattern_match ( group, pattern )
{
return ( string_match( group, fix_regexp( strcat( "\\C", pattern ) ), 1 ) );
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% End of convenience functions. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Re: Scoring with S-Lang function (Was: Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.))
Author: obsc... obscurity
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
27 lines
2199 bytes
2199 bytes
On 18 Aug 1998 04:23:09 GMT, Jan Hlavacek <lah...@math.mps.ohio-state.edu> wrote: > On Tue, 18 Aug 1998 01:29:23 GMT, obscurity <obsc...@obscure.org> > wrote: > > There are also other things I'd like to be able to do that slrn > > doesn't let me (like do article scoring by passing the article to a > > slang function that returns the score, thus giving maximum > > flexibility) > > Actually, you can do this in slrn. Try something like this: [snipped for consideration when I have more time . . . .thanks !] > > I realise that at least some of this could be 'solved' by using > > multiple windows in a gui environment, but I *hate* gui's and am > > strictly (or as strictly as my OS allows) a full-screen, text-mode > > only person. > > Did you try "screen"? On a win95 box ? -- obscurity. "Only the great masters of style ever succeed in being obscure." - Oscar Wilde
Scoring with S-Lang function (Was: Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.))
Author: lah... Jan Hlavacek
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
66 lines
3269 bytes
3269 bytes
On Tue, 18 Aug 1998 01:29:23 GMT, obscurity <obsc...@obscure.org>
wrote:
> There are also other things I'd like to be able to do that slrn
> doesn't let me (like do article scoring by passing the article to a
> slang function that returns the score, thus giving maximum
> flexibility)
Actually, you can do this in slrn. Try something like this:
define score_article_with_function (f)
{
set_header_score (@f(get_header_score (), article_as_string ()));
}
define identity (score, article)
{
return (score);
}
variable Scoring_Function = &identity;
define article_mode_hook ()
{
call ("header_bob");
do
{
if (is_thread_collapsed ())
{
uncollapse_thread ();
loop (thread_size () - 1)
{
score_article_with_function (Scoring_Function);
header_down (1);
}
score_article_with_function (Scoring_Function);
collapse_thread ();
}
else score_article_with_function (Scoring_Function);
header_down (1);
}
call ("header_bob");
}
You can then write your own scoring function which takes current score
and the article as a string as arguments and returns new score, and
assign it to the Scoring_Function. I didn't test it, it may need some
changes, like maybe few ERRORBLOCKs and so on. You can also make it
even more flexible, like make the Scoring_Function not take any
arguments at all, and get them all using the low level slrn functions
(so you don't need to download the bodies of articles which you know you
don't want to score and so on).
> I realise that at least some of this could be 'solved' by using
> multiple windows in a gui environment, but I *hate* gui's and am
> strictly (or as strictly as my OS allows) a full-screen, text-mode
> only person.
Did you try "screen"?
--
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/
Re: Scoring with S-Lang function (Was: Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.))
Author: Lloyd Zusman
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
117 lines
6634 bytes
6634 bytes
Speaking of scoring with an S-Lang function, here's the thing I wrote
last year to aid in converting a standard slrn score file to some
S-Lang code which does the same thing. Once you run your score file
through this Perl script, you can dispense with the score file
altogether and use the resulting S-Lang code, instead. The full
complement of S-Lang features will then be available to you for doing
any kind of scoring you like.
This post contains the README file, and the other post in this series
contains the Perl script itself, called "scoregen". Please read the
README file completely before attempting to make use of "scoregen".
All feedback is welcome.
Lloyd Zusman
l...@asfast.com
----------------------------- README file -----------------------------
scoregen -- Generate S-Lang scoring routines from an Slrn score file
--------------------------------------------------------------------
Version 0.04
Lloyd Zusman <l...@asfast.com>
1998/08/12
IMPORTANT NOTE: PLEASE READ ALL OF THIS BEFORE USING THIS SOFTWARE
BACKGROUND
----------
This is scoregen, a Perl script that reads an Slrn score file as input
and uses it to produce a group of S-Lang routines which perform the
same scoring functions.
The idea for scoregen came to me in the fall of 1997 during a
discussion in news.software.readers among some of us Slrn aficionados.
One of us, J.B. Nicholson-Owens <j...@pop-a-wheelie.midwest.net>, was
suggesting that Slrn's score-file processing be enhanced with variable
expansion and perhaps some simple functional processing.
During the ensuing debate, it occurred to some of us that this
functionality and a lot more could be had simply by doing the scoring
directly from within S-Lang instead of via the standard score file.
Some objections to this idea were raised, and most of them had to do
with the idea that it would be complicated and time-consuming to
manually construct the appropriate S-Lang code based upon an
arbitrary, existing score file, especially one which is large. It was
at this point that I conceived of the current form of scoregen.
Scoregen answers these objections because it automatically generates
the appropriate S-Lang code by reading a standard score file as input.
Once this code is generated, it is expected to be invoked within
Slrn's article_mode_hook(), at which time it will perform the
requested scoring.
The following point is important, and so I'm putting it in caps:
SCOREGEN IS ONLY INTENDED TO BE USED ONCE PER SCORE FILE
In other words, the recommended use of scoregen is for you to feed
your score file through it once and only once, to start using the
resulting S-Lang code for scoring, and to then stop using your score
file (and scoregen!) altogether. From then on, you should use the
resulting S-Lang routines to do your article scoring, and you should
modify the S-Lang code directly if you want to make any changes to
your scoring rules.
The main advantage in using the resulting S-Lang-based routines is so
that you can easily make use of the added flexibility that you can get
via programatic scoring. Given that the resulting S-Lang-based
scoring routines will run somewhat slower that the optimized, compiled
C routines that currently do scoring in Slrn, you should probably just
stick to using a standard score file if you don't want this added
programatic flexibility.
Of course, if S-Lang-based scoring catches on, it can be speeded up
quite a bit if some new S-lang or Slrn intrinsics would be defined.
Scoregen generates the following S-lang routines:
score_article() This routine scores each article. It's
what gets generated from your score file,
and its structure is pretty much parallel
to that of your score file.
do_scoring() This routine loops through all the articles
in a newsgroup, calling score_article()
on each one. It's designed to be invoked
from within article_mode_hook. Alternatively,
the name of this routine can be changed to
"article_mode_hook", and it'll work just
fine in this manner.
convenience routines The above two routines make use of a few
convenience routines that I wrote to
simplify the S-Lang-based scoring
procedure. These convenience routines are
also generated by scoregen.
Some of the convenience routines I wrote are nearly direct recodings
of C routines that exist in the S-Lang and Slrn source code. These
routines are good candidates to be turned into S-lang or Slrn
intrinsics. The rest of the convenience functions can also be made
into intrinsics if this is deemed useful.
Note that another major purpose of scoregen is to stimulate discussion
and debate about S-Lang-based scoring. Although I spent some time
trying to optimize scoregen and make it useful, I don't necessarily
consider it to be the last word in Slrn scoring. I'm hoping that
through our discussions, we Slrn lovers can come up with the best and
most useful approaches to scoring, whether or not S-lang-based scoring
is ever used.
Re: Why reinvent slrn? (was: Re: [slrn] Preventing an S-Lang macro from aborting.)
Author: obsc... obscurity
Date: Tue, 18 Aug 1998 00:00
Date: Tue, 18 Aug 1998 00:00
66 lines
4818 bytes
4818 bytes
On 17 Aug 1998 18:46:44 GMT, Dawn Owens-Nicholson <blue...@ux6.cso.uiuc.edu> wrote: > obscurity <obsc...@obscure.org> wrote: > > [I started writing a newsreader in slang, so I could run it from within Jed > > (I *really* like the emacs/gnus model), > > But do you like it enough to justify rewriting all the code that has gone > into slrn? I'm still undecided... I keep doing snippets of it when I'm completely bored and have nothing better to do with my time, but I'm not devoting a huge amount of effort to it precisely because I can't decide if it's worth it or not. > If so, why? I'm genuinely curious about this; I don't see what > the significant advantages are to making a newsreader for jed versus using > jed to edit articles and slrn for newsreading. Well, I guess it depends on the way you like to work. I like the idea of having the group, summary and article 'windows' as jed buffers so that I can have multiple groups/summaries/articles open at the same time and switch between them easily (and cutting'n'pasting as I go), or have any combination of them split onto the same screen. I like the idea of being able to have a consistent user interface between my editor and my newsreader (slrn doesn't let me configure it to look like I have Jed configured, and for some reason I haven't been able to persuade slrn to map the cursor keys to do what I want at all). I like the idea of being able to use all my editor macros from within my newsreader without any extra effort. I like the idea of not having to leave my editor and fire up my newsreader whenever I want to have a quick peek at usenet. I like the idea of being able to use Jed's extra functionality when processing summary and article buffers. There are also other things I'd like to be able to do that slrn doesn't let me (like do article scoring by passing the article to a slang function that returns the score, thus giving maximum flexibility) that I would be able to do easily if I were to write the newsreader myself. (I always find it easier to just write something myself than to get my head round someone else's code. I don't think my brain works like most other people's :) ) Basically, I like the flexibility that this approach would give me. I realise that at least some of this could be 'solved' by using multiple windows in a gui environment, but I *hate* gui's and am strictly (or as strictly as my OS allows) a full-screen, text-mode only person. > I think it would be a far more productive use of your time to work on a > Usenet/e-mail mode for jed so quoting is handled appropriately when > reformatting paragraphs (this has already been written, but could be > included in such a mode, if the author permits), doesn't word wrap when > editing headers but does word wrap when editing unquoted paragraphs, wraps > in a way that preserves quoting when editing quoted lines and doesn't > truncate the trailing space on the sigdash line (defining the sigdash line > as the line closest to the bottom that matches "^-- ?$"). [I could switch to > emacs, which I believe can do much, if not all, of this, but I've been > editing S-Lang code for a while now and jed is the best editor I've seen to > do that. I don't want to learn multiple editors if I can avoid it.] A usenet/email mode isn't too high on my list of priorities at the moment, but if/when I do get round to writing one, I'll try to remember to post it here. Bear in mind that I'm incredibly lazy, though, and so it May Take Some Time :) -- obscurity. "Only the great masters of style ever succeed in being obscure." - Oscar Wilde
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: da... John E. Davis
Date: Wed, 19 Aug 1998 00:00
Date: Wed, 19 Aug 1998 00:00
20 lines
1527 bytes
1527 bytes
On 16 Aug 1998 20:00:05 -0400, Lloyd Zusman <l...@asfast.com> wrote: >But before I run off and do any of this, what do you folks think about >this idea? I'd hate to go to all this trouble and then find out that >no one is interested, or that there's already a site like this >somewhere that we just don't know about. > >I also would like some feedback from John Davis as to his preferences >about this before we do anything. I apologize for not responding sooner. I am going to be very busy with work-related projects for the next few months. Pardon my ignorance in this respect, but what advantages of something like slang.org over standard web pages? Thanks, --John
Re: [slrn] Preventing an S-Lang macro from aborting.
Author: l... Lloyd Zusman
Date: Wed, 19 Aug 1998 00:00
Date: Wed, 19 Aug 1998 00:00
45 lines
3026 bytes
3026 bytes
On 19 Aug 1998 21:49:51 GMT, John E. Davis <da...@space.mit.edu> wrote: > On 16 Aug 1998 20:00:05 -0400, Lloyd Zusman <l...@asfast.com> > wrote: > >But before I run off and do any of this, what do you folks think about > >this idea? I'd hate to go to all this trouble and then find out that > >no one is interested, or that there's already a site like this > >somewhere that we just don't know about. > > > >I also would like some feedback from John Davis as to his preferences > >about this before we do anything. > > I apologize for not responding sooner. I am going to be very busy > with work-related projects for the next few months. > > Pardon my ignorance in this respect, but what advantages of something > like slang.org over standard web pages? Well, it would be easy for people to remember, especially because it's of the same form as `gnus.org', `perl.org', etc. Also, with a standardized name like that, if at some point the person(s) maintaining the site wanted to give up the task and pass it on to others, or if the hosting ISP went out of business, the site could be re-hosted at a different IP address, but with the same domain name. No existing links or bookmarks would be broken. Furthermore, the domain could easily be pointed at an already-existing web site, if desired. By the way, I have just today taken the liberty to register `s-lang.org' (with the hyphen). I could quickly register `slang.org', as well. I won't host this anywhere unless you give the go-ahead, John ... I'm just holding it so that we can have it if we want. If you, John, want control of that domain name, I'll gladly give it to you (for free, and with no strings attached). Or if you don't want it used, I promise that I won't do anything with it for the next two years until the name expires. Or whatever. I'm not here to make money off of it or to try to control it in any way. I just wanted to make sure that no one could grab it ahead of the S-Lang community (such as it is <smile>). -- Lloyd Zusman 01234567 <-- The world famous Indent-o-Meter. l...@asfast.com ^ Indent or be indented.
S-lang.org (was Re: [slrn] Preventing an S-Lang macro from aborting.)
Author: Rich Roth
Date: Thu, 20 Aug 1998 00:00
Date: Thu, 20 Aug 1998 00:00
46 lines
2876 bytes
2876 bytes
John, I agree with Lloyd whole heartedly.
The www.s-lang.org makes it far easier to find - there have been a
number of complaints about
some news servers not carrying the newsgroup and today a 'guessable'
domain is the first
place most people look.
Also, your own message makes the point about your time -- any good
system needs a
place that doesn't totally relying on one person having enuf time to
keep it up.
You've done a mighty fine job with S-lang, Jed and Slrn -- let's get
some more
momentum behind them, and a 'named' web site will help.
Lloyd Zusman wrote:
>
> On 19 Aug 1998 21:49:51 GMT, John E. Davis <da...@space.mit.edu> wrote:
> > I apologize for not responding sooner. I am going to be very busy
> > with work-related projects for the next few months.
> >
> > Pardon my ignorance in this respect, but what advantages of something
> > like slang.org over standard web pages?
> Well, it would be easy for people to remember, especially because it's
> of the same form as `gnus.org', `perl.org', etc. Also, with a
> standardized name like that, if at some point the person(s)
> maintaining the site wanted to give up the task and pass it on to
> others, or if the hosting ISP went out of business, the site could be
> re-hosted at a different IP address, but with the same domain name.
> No existing links or bookmarks would be broken.
>
> Furthermore, the domain could easily be pointed at an already-existing
> web site, if desired.
--
Rich Roth On-the-Net
Box 927 Northampton, MA 01061
Voice: 413-586-9668 ri...@on-the-net.com http://www.on-the-net.com
~~~ Add Instant Depth to your Website from www.i-depth.com ~~~
~~~ Adding depths to Web presences and Internet providers ~~~~~
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