🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
8 messages
8 total messages Started by Matthias.Maisenbacher Tue, 12 Jan 1999 00:00
[SLRN] how to delete automarically reply threads?
#45877
Author: Matthias.Maisenbacher
Date: Tue, 12 Jan 1999 00:00
28 lines
1336 bytes
Hi,

I'm looking for a method (maybe a macro) to delete all threads which
start with a re: arcicle.

Example:

A thread consisting of 3 acticles:
HI PLEASE IGNORE THIS (3)
According to the wonderful subject I'm deleting the thread with 'd'.

Overnight there are new postings. Next time when I enter slrn I see:
RE: HI PLEASE IGNORE THIS (3)
Now i *could* delete this again with 'd'.

I'm looking for something which deletes all those threads
when I enter slrn or the specific group.

Or something I could call being in a group.

No, I won't delete all articles whose subjects begin with re:.
Yes, I know about scoring by reference.

Thank You for all ideas, macros, hints...

      Matthias

Re: [SLRN] how to delete automarically reply threads?
#45897
Author: John Moreno
Date: Tue, 12 Jan 1999 00:00
35 lines
1763 bytes
Matthias.Maisenbacher <Matthias.Maisenbacher@pcm.bosch.de> wrote:

> Hi,
> 
> I'm looking for a method (maybe a macro) to delete all threads which
> start with a re: arcicle.
> 
> Example:
> 
> A thread consisting of 3 acticles:
> HI PLEASE IGNORE THIS (3)
> According to the wonderful subject I'm deleting the thread with 'd'.
> 
> Overnight there are new postings. Next time when I enter slrn I see:
> RE: HI PLEASE IGNORE THIS (3)
> Now i *could* delete this again with 'd'.
> 
> I'm looking for something which deletes all those threads
> when I enter slrn or the specific group.
> 
> Or something I could call being in a group.
> 
> No, I won't delete all articles whose subjects begin with re:.
> Yes, I know about scoring by reference.
> 
> Thank You for all ideas, macros, hints...

Looks like what you want is to kill all articles with subjects
(excluding the "Re: ") with only caps or non alpha.  I believe that is
in the FAQ.

-- 
John Moreno

Re: [SLRN] how to delete automarically reply threads?
#45904
Author: Dawn Owens-Nicholson
Date: Tue, 12 Jan 1999 00:00
75 lines
2863 bytes
Matthias.Maisenbacher wrote:
> I'm looking for a method (maybe a macro) to delete all threads which
> start with a re: arcicle.

Put these three functions into a file:

     define delete_thread ()
     {
	if (is_group_mode ())
	  error (_function_name () + " doesn't work in group mode!");

	variable
	  starting_article = extract_article_header ("Message-ID"),
	  starting_thread_was_collapsed = is_thread_collapsed ();

	collapse_thread ();
	call ("delete_thread");
	set_input_string (starting_article);
	call ("locate_header_by_msgid");
	if (starting_thread_was_collapsed) collapse_thread ();
     }

     define goto_end_of_thread ()
     {
	if (is_group_mode ())
	  error (_function_name () + " doesn't work in group mode!");

	collapse_thread ();
	uncollapse_thread ();
	() = header_down (thread_size () - 1);
     }

     define delete_re_threads ()
     {
	if (is_group_mode ())
	  error (_function_name () + " doesn't work in group mode!");

	variable
	  starting_article = extract_article_header ("Message-ID"),
	  starting_thread_was_collapsed = is_thread_collapsed (),
	  thread_was_collapsed = 0;

	call ("header_bob");

	do
	  {
	     thread_was_collapsed = is_thread_collapsed ();
	     if (string_match (extract_article_header ("Subject"), "^Re: ", 1))
	       delete_thread ();
	     goto_end_of_thread ();
	     if (thread_was_collapsed) collapse_thread ();
	  }
	while (header_down (1));

	set_input_string (starting_article);
	call ("locate_header_by_msgid");
	if (starting_thread_was_collapsed) collapse_thread ();
     }

You didn't say how you wanted to handle sub-threads starting with articles
with Subject: headers that don't match "^Re: ", so I decided to keep the
function simple by not handling them--they get marked as read too.  I didn't
bother to remove the duplicate collapse_thread()s because they don't cost
much time to execute and now you've got two functions you can easily reuse.

Run this from article_mode_hook() by defining the hook thusly:

     define article_mode_hook ()
     {
        delete_re_threads ();
     }

Of course, other code can run in the hook too.  Happy newsreading!

Re: [SLRN] how to delete automarically reply threads?
#45937
Author: Matthias Maisenbacher
Date: Thu, 14 Jan 1999 00:00
21 lines
1190 bytes
>Put these three functions into a file:

>[...] sl-macros dealing with threads

Thank you for these functions. They work well.
Maybe too well. I don't know why, but since then I'm missing 
*many* postings.

And - I have to switch off the functions while normal reading.
If I don't, the function deletes all articles of a thread when I start
reading the first of its articles. 

I have to look a bit deeper inside the functions.

     Thank you again anyway

              Matthias
-- 
(Matthias.Maisenbacher@pcm.bosch.de)

Re: [SLRN] how to delete automarically reply threads?
#45942
Author: Dawn Owens-Nicholson
Date: Thu, 14 Jan 1999 00:00
62 lines
3404 bytes
Matthias Maisenbacher wrote:
> But it isn't what I'm looking for.

It sounded to me like a good answer.  I tried another approach of
interpreting the problem statement.

> I want delete all threads which starts with an re (or Re or RE) *when
> collapsed*

So, only consider the article at the head of the thread, visually speaking?
That is, collapse the thread, consider whether it matches, delete the
articles in the collapsed thread (?) xor move to the next visual-thread?

For instance, if a thread looks like this:

   Indian food is excellent
     +-Yes, it is.  It's the best vegetarian food I've had in a long time.
     +-Re: Indian food is excellent
     +-I could go for a spicy mushroom masala right now (was: Re: Indian...)

there are at least four articles in the thread.  When collapsed, only the
"Indian food is excellent" article will be left on the screen.  Would this
be a match or not?  Visually speaking, I'd guess not, but there is a child
thread ("Re: Indian food is excellent") that I'd guess matches.  It depends
on how one interprets things.

If you marked all four articles as read (for whatever reason) and later
people continued to post in this thread:

       +-Re: Indian food is excellent
         +-Re: Indian food is excellent
	 +-Did Hitler enjoy vegetarian food?
	   +-Uhoh--Hitler alert!  Thanks for ruining the thread.

Are these articles to be marked as read by the macro?  The article (visually
speaking) at the head of the thread has a matching Subject: header, but that
article is the followup to an article that might not have matched.

> Target: I'm not interestet to delete the same thread again day 
> for day.

Putting a working macro in your article_mode_hook() would do the job for you
such that you could still go back and read the offending articles if
you wanted.  If you prefer to remove them from the header list, that can be
done too, with a speed penalty that increases with the size of the header
list (using a macro to do scoring jobs is generally slower than using
scoring).

If you were to kill certain threads instead, the speed penalty goes away
(scoring in slrn is quite fast) and you can still get the convenience of
single-button access to kill a (sub)thread.  Hence, scoring is a viable
option if you score on References: (which you said you knew how to do).

We want to help, but it's hard when the problem is sufficiently vague.



[1] (I'm assuming by starting with a case-insensitive "re" you also mean the
    following colon, or else you're *really* talking something that will
    match more articles than you expect).

Re: [SLRN] how to delete automarically reply threads?
#45945
Author: Matthias Maisenbacher
Date: Thu, 14 Jan 1999 00:00
24 lines
1195 bytes
>> A thread consisting of 3 acticles:
>> HI PLEASE IGNORE THIS (3)

>Looks like what you want is to kill all articles with subjects
>(excluding the "Re: ") with only caps or non alpha.  I believe that is
>in the FAQ.

Yes, *that* is in the FAQ.
But it isn't what I'm looking for.

I want delete all threads which starts 
with an re (or Re or RE) *when collapsed*

Target: I'm not interestet to delete the same thread again day 
for day.

Hope this clears.

   Matthias

-- 
(Matthias.Maisenbacher@pcm.bosch.de)

Re: [SLRN] how to delete automarically reply threads?
#45946
Author: Dawn Owens-Nicholson
Date: Thu, 14 Jan 1999 00:00
23 lines
1828 bytes
Matthias Maisenbacher wrote:
> Thank you for these functions. They work well.
> Maybe too well. I don't know why, but since then I'm missing 
> *many* postings.

Of course you are--lots of articles match the criteria in the program.  If
you were more specific about what you wanted, perhaps we n.s.r readers could
guide you to a more satisfactory solution.  As you can tell by the variety
of responses you're getting, your original statement of the problem was less
than clear.

> And - I have to switch off the functions while normal reading.
> If I don't, the function deletes all articles of a thread when I start
> reading the first of its articles. 

I don't understand what this means.  The function you're supposed to execute
only marks articles as read.  It doesn't remove those headers from the
display or quit article mode or interfere with the normal operation of any
slrn newsreading command.  You can always mark threads as unread or mark
subthreads as read with slrn commands yourself, but this gets right back to
the original statement of the problem.

Re: [SLRN] how to delete automarically reply threads?
#46028
Author: Dawn Owens-Nicholson
Date: Tue, 19 Jan 1999 00:00
71 lines
3034 bytes
Matthias.Maisenbacher wrote:
> I'm looking for a method (maybe a macro) to delete all threads which
> start with a re: arcicle.

After going back and forth on this, here's another way to do it.  Save this
into a file, and run it from article_mode_hook() for the groups you want to
prune in this way.  This doesn't kill threads, just mark them read (or
deleted).  Killing these threads would require a longer macro and more
execution time.  You shouldn't need to kill the articles if you use prev,
next and scroll_dn (by default--"p", "n" and spacebar, respectively) to read
articles.

Happy newsreading!



% Delete visual-threads where the thread head article           % -*- slang -*-
% matches "^[rR][eE]:".
%
% Author: J.B. Nicholson-Owens
%
% Matthias Maisenbacher <Matthias.Maisenbacher@gmx.de> was interested in this.
%
% Note: slrn's delete_thread intrinsic is different from:
%
%          loop (thread_size () - 1)
%            {
%               set_header_flags (get_header_flags () | HEADER_READ);
%               () = header_down (1);
%            }
%          set_header_flags (get_header_flags () | HEADER_READ);
%
%       because the latter leaves the cursor at the next thread.  The
%       intrinsic leaves the cursor at the next unread article, and is
%       therefore not applicable to this task.

define matthias_delete_threads ()
{
   if (is_group_mode ())
     error (_function_name () + " doesn\'t work in group mode!");

   variable
     thread_was_collapsed = 0,
     starting_article = extract_article_header ("Message-ID"),
     starting_thread_was_collapsed = is_thread_collapsed ();

   call ("header_bob");
   do
     {
	thread_was_collapsed = is_thread_collapsed ();
	if (string_match (extract_article_header ("Subject"), "^[rR][eE]:", 1))
	  {
	     uncollapse_thread ();
	     loop (thread_size () - 1)
	       {
		  set_header_flags (get_header_flags () | HEADER_READ);
		  () = header_down (1);
	       }
	     set_header_flags (get_header_flags () | HEADER_READ);
	     if (thread_was_collapsed) collapse_thread ();
	  }
	else !if (thread_was_collapsed) () = header_down (thread_size () - 1);
     }
   while (header_down (1));
   
   set_input_string (starting_article);
   call ("locate_header_by_msgid");
   if (starting_thread_was_collapsed) collapse_thread ();
}

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