% -*- mode: slang; mode: fold -*- %{{{ % Manipulating followup_string (by Tomasz Sienicki, tsca@edb.dk) % Read more @ http://www.geocities.com/tsca.geo/slang.html % Wed, 10 May 2000, 22:52:03 % % Tue, 14 Nov 2000, 19:22:07 % !!! DON'T USE this macro with !!! % Sun, 07 Jan 2001, 13:00:54 % !!! slrn newer than 0.9.6.4 !!! % Sat, 17 Mar 2001, 22:48:06 % Get the newer version at the above address. % Wed, 13 Feb 2002, 23:45:24 % % ------------------------------------------------------------------ %}}} define tsca_s_followup_data () { variable orgdata=extract_article_header("Date"),len,hvr; if(string_match(orgdata,"\\([0-9]?[0-9] [A-Z][a-z][a-z] 2?0?0[0-9]\\)",1)) {(hvr,len)=string_match_nth(1);orgdata=substr(orgdata,hvr+1,len);} while (str_replace(orgdata,"2000","2k")) orgdata=(); variable z,i,months=["Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec"]; for (i = 0; i <= 11; i++) { z=string(i+1); if (strlen(z)==1) z=".0"+z+"."; else z="."+z+"."; while (str_replace(orgdata," "+months[i]+" ",z)) orgdata=(); } return orgdata; } define tsca_s_followup_msgid () { variable orgmsgid=extract_article_header("Message-ID"); while (str_replace(orgmsgid,"<","news:")) orgmsgid=(); while (str_replace(orgmsgid,"%","2pro_cent")) orgmsgid=(); while (str_replace(orgmsgid,"2pro_cent","%%")) orgmsgid=(); while (str_replace(orgmsgid,">","")) orgmsgid=(); return orgmsgid; } % ---------------------------------------------------------------------- define followup_hook() { variable nowadata=tsca_s_followup_data, nowymsgid=tsca_s_followup_msgid, followupstring = sprintf(" %%r wrote\n in %s on %s:\n",nowymsgid,nowadata); set_string_variable ("followup_string", followupstring); } % -------------------------------------------------------------------- % if geocities puts anything below, delete it :-( % --------------------------------------------------------------------