% -*- mode: slang; mode: fold; -*-                                     %{{{
% sv2re by Tomasz 'tsca' Sienicki, http://www.geocities.com/tsca.geo/slang.html
% this macro changes the reply prefix (back to 'Re: ') when you follow up 
% a post written by a person using MS Outlook. Not that it really matters, 
% threading should be based on References:, but some people use Subject: 
% for that purpose anyway. Examples:
% * Subject: Sv: Hi!                     --> Subject: Re: Hi!
% * Subject: Odp: Odp: Czesc!            --> Subject: Re: Czesc!
% * Subject: Re: Sv: Odp: Odp: Odp: Hej! --> Subject: Re: Hej!
% Remember to add the function to hooks if they already exist;
% DO NOT redefine them.                                                %}}}

define sv2re ()
{
  variable art = article_as_string, st1 = string_match(art,"\n$",1),coo,
           hov = substr(art,1,st1), kro = substr(art,st1,-1), h=0, prfx;

  loop (2)
   { foreach (["Sv","Odp","An","Re: Odp","Re: Sv","Re: An","Re: Re"])
     { prfx=(); coo = sprintf("\nSubject: %s:",prfx);
       while(string_match(hov,coo,1))
        { while(str_replace(hov,coo,"\nSubject: Re:")) hov=(); h=1; }
   } }

 if(h) { art = hov+substr(kro,2,-1); replace_article (art); }
}

 define followup_hook () { sv2re; }

    Source: geocities.com/tsca.geo/slang

               ( geocities.com/tsca.geo)