🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #82171

Re: [slrn] feature request

#82171
From: J.B. Nicholson-Owens
Date: Mon, 30 Jul 2001 02:23
69 lines
3244 bytes
Pardoz wrote:
>      Try this macro combined with a scorefile entry to give your own
> articles a score of 9999.  It will automatically *tag your own articles.

Instead of creating a 'magic' score, you'd be better off scanning for your
own articles.  Assigning values to actions that have nothing to do with
scoring doesn't work well with additive scores (a feature of slrn's scoring)
and isn't self-documenting.

> define tag_high_scores ()
> {

You could insert this:

      variable starting_point = extract_article_header ("Message-ID");

here which would pay off later.

>   forever
>     {
>      variable header = get_header_score();
>      if (header = 9999) set_header_flags (HEADER_TAGGED);

This won't work as is and when the syntax errors are fixed it'll clobber
whatever flags are on the header in favor of setting HEADER_TAGGED.  You
could rewrite the inside of the loop as:

      if (string_match (extract_article_header ("From"), "my name here", 1))
          set_header_flags (get_header_flags () | HEADER_TAGGED);

to do something more in line with the request.  Of course, one would want to
change 'my name here' to their name or e-mail address (or perhaps get it
from an argument to the function, environment variable, or setting
somewhere).

>         !if (header_down (1))
>           break;
>      }

Another approach is a do-while loop:

  uncollapse_all_threads ();
  do
    {
      if (string_match (extract_article_header ("From"), "my name here", 1))
         {
            set_header_flags (get_header_flags () | HEADER_TAGGED);
         }
    }
  while (header_down (1));
  collapse_all_threads ();

If you prefer, you can make the whole loop without curly braces since it's
two lines of code.

>    call ("header_bob");

Another way to do it would be to reset the cursor's position.  It's quick
and easy and a nice thing to do.

   () = locate_header_by_msgid (starting_point, 0);

I'd normally not want to disturb the thread display too but I'm not sure
there's a point to doing that at the time this macro would run.  Call it an
excercise left for the reader.

Finally, if you install StickyTags http://forestfield.org/slrn/#stickytags
you can make the asterisk tags last across sessions.
Technical Details
Message-ID: <slrn9m9h63.an.jbn@forestfield.org>
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!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail
References: <slrn9m4sg4.qpi.Faux_Pseudo@faux.cx936102-a> <slrn9m6pdg.3vuc76h.pardoz@pardbox.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn9m9h63.an.jbn@forestfield.org>
Subject: Re: [slrn] feature request
Date: Mon, 30 Jul 2001 02:23:40 +0000
From: jbn@forestfield.org (J.B. Nicholson-Owens)
References: <slrn9m4sg4.qpi.Faux_Pseudo@faux.cx936102-a> <slrn9m6pdg.3vuc76h.pardoz@pardbox.com>
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!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!forestfield.ORG!not-for-mail
Newsgroups: news.software.readers
Organization: Forest Field OmniMedia
Lines: 68
NNTP-Posting-Host: forestfield.org (208.216.67.173)
X-Trace: fu-berlin.de 996459820 2290546 208.216.67.173 (16 [35848])
X-License: The code in this post is licensed to you under the GNU GPL.
User-Agent: slrn/0.9.7.1 (Unix)