🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Thomas Schultz Sat, 20 Mar 1999 00:00
slrn: Automatically setting 'Followup-To:' in followup_hook
#47405
Author: Thomas Schultz
Date: Sat, 20 Mar 1999 00:00
34 lines
2042 bytes
Hi,

When writing a followup to an article that has been crossposted, I
sometimes forget to set an appropriate 'Followup-To:'-header. To avoid
this, I tried to write a macro that would do it automatically:

define followup_hook ()
{
   if (is_substr(extract_article_header("newsgroups"), ",") and not
       strlen(extract_article_header("followup-to")))
     switch (get_yes_no_cancel ("Automatically set 'Followup-To:' to current newsgroup"))
              { case -1 : error ("Cancelled."); }
              { case 1  :
                   {
                      variable sedcmd;

                      sedcmd = sprintf ("'1,/^$/s/\\(^Followup-To:\\)/\\1 %s/'", current_newsgroup());
                      () = system (sprintf ("sed -e %s ~/.followup > ~/.followup.sed; mv ~/.followup.sed ~/.followup", sedcmd));
                   }
              }
}

Of course, this does not work, because followup_hook() is called
*before* slrn writes the article to .followup. This is certainly
useful for other macros (e.g. if they set followup_custom_headers to a
new value), so it should not be changed.

Is it possible to do this in a different hook? If not, would it be
possible to add an appropriate hook in a future version of slrn?
-- 
Kind regards,
    Thomas Schultz

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