🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #241779

Re: [slrn] True offline mode

#241779
From: ernobe
Date: Tue, 20 Jul 2010 22:47
106 lines
5363 bytes
>
>>> when I set sorting_method to 12 ( custom ), custom_sort_by_threads to 1 ( 
>>> do threading ), and put bodies first ( rather bodiless first ) in 
>>> custom_sort_order, I'm left with header only threads and individual messages 
>>> first, before the threads with bodies.  What I'd like it do is apply a score 
>>> so that subjects beginning with Re: that appear in the first, header only 
>>> section are killed.  But it doesn't seem possible, because if I kill such 
>>> subjects it will kill them all, including the ones in threads that already 
>>> have articles with bodies.  In other words, I'd like to see only new subject 
>>> messages or threads in the header only section.
>>>
>> The following could work if all article subjects beginning with Re: had a 
>> parent on the server.Could someone tell me why it doesn't delete the articles 
>> that have a parent, please?
>>  
>>     define make_clean_threads ()
>>     {
>>         call ("header_bob");
>>         do
>>           {
>>              if (1 == has_parent ()) call ("delete_thread");
>>           }
>>         while (header_down (1));
>>     }
>>     () = register_hook ("article_mode_startup_hook",
>> 			"make_clean_threads" );
>
> This does it:
>
>     define make_clean_threads ()
>     {
>         call ("header_bob");
>         do
>           {
>              if (not ("" == extract_article_header ("References"))) 
> 		{ 
> 			call ("delete");
>              		header_up (1); 
> 		}
>           }
>         while (header_down (1));
>         call ("expunge");
>     }
>     () = register_hook ("article_mode_startup_hook",
> 			"make_clean_threads" );
> 			
>
> For some reason, call ("delete"); moves the cursor down to the next header, so 
> it is necessary to call header_up (1) after it.  This code does not delete any 
> messages that don't have a references line, after threading ( so it does not 
> affect their "children" ), so hopefully all that is left are new subject 
> messages or threads.  Will have to see if there is a problem with replies to 
> messages that don't have a references line, and what to do with them.
>   
For the sake of completeness here is how the macro currently stands:


    define make_clean_threads ()
    {
        call ("header_bob");
        do
          {
             if (not ("" == extract_article_header ("References"))) 
             {
                if (0 == get_body_status ()) set_header_flags (HEADER_TAGGED);
                else 
                { 
            	    call ("delete");
            	    continue; 
            	}
            }
          }
        while (header_down (1));
        call ("expunge");
    }
    () = register_hook ("article_mode_startup_hook",
			"make_clean_threads" );
			
    define post_filter_hook (file)
    {	
	variable cmd = "mycont";
	() = system (sprintf ("%s '%s'", cmd, file));
    }

			
All this saves me from using two other macros, stickytags and one-key-stroke, 
the only ones I had been using ( beside get-by-mid which didn't seem to work). 
Here's how it works: the post filter hook calls a program that creates a 
score in the slrnpull scorefile that will download the bodies of replies to 
the article posted, which the make_clean_threads function will tag instead of 
deleting.  No need for stickytags or in fact no need to use scoring in slrn 
with or without one-key-stroke, because the articles get tagged instead of 
scored.  Unfortunately, I don't generate my own message-ids, ( I just found 
out by trying to post this article, that the filter mechanism writes to the 
scorefile but does not include the message-id ) so I will have to figure out a 
way to get the information from my saved-posts file, since the server provides 
a message-id, but too late to be used with the filter hook.  Is there a way to 
use the post_hook function to get the message-id supplied by the server?



-- 
"The world of existence is an emanation of the merciful attribute of God."
Abdu'l-Baha
http://www.costarricense.cr/pagina/ernobe
Technical Details
Message-ID: <i2591a$4v0$1@news.eternal-september.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.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news2.euro.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail
References: <i1fnkv$c3i$1@news.eternal-september.org> <i22han$4uk$1@news.eternal-september.org> <i22vbu$qm4$1@news.eternal-september.org>

Show Full Headers
Complete Article Headers
Message-ID: <i2591a$4v0$1@news.eternal-september.org>
Subject: Re: [slrn] True offline mode
Date: Tue, 20 Jul 2010 22:47:06 +0000
From: ernobe <ernobe@yahoo.com>
References: <i1fnkv$c3i$1@news.eternal-september.org> <i22han$4uk$1@news.eternal-september.org> <i22vbu$qm4$1@news.eternal-september.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.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news2.euro.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: Baha'i Faith
Lines: 106
Injection-Date: Tue, 20 Jul 2010 22:47:06 +0000 (UTC)
Injection-Info: mx01.eternal-september.org;
 posting-host="Q91/9pHQc4495fR8Rd6wLg";
 logging-data="5088"; mail-complaints-to="abuse@eternal-september.org";
 posting-account="U2FsdGVkX19gcwXzO7ugY3HvfZ/pRI/iusL7/yp6Xhc="
User-Agent: slrn/pre1.0.0-18 (Linux)
Cancel-Lock: sha1:33w7PKe7BUcXECUjXFxc81rDdqE=
X-Original-Bytes: 5123