Article View: news.software.readers
Article #47405slrn: Automatically setting 'Followup-To:' in followup_hook
From: Thomas Schultz
Date: Sat, 20 Mar 1999 00:00
Date: Sat, 20 Mar 1999 00:00
34 lines
2042 bytes
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
Technical Details
Message-ID:
<slrn7f86is.1m0.tststs@tststs.ddns.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.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn7f86is.1m0.tststs@tststs.ddns.org> Subject: slrn: Automatically setting 'Followup-To:' in followup_hook Date: Sat, 20 Mar 1999 00:00:00 +0000 From: tststs@gmx.de (Thomas Schultz) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 457032484 X-Server-Date: 20 Mar 1999 21:59:56 GMT X-Trace: news1.cityweb.de 921971256 62.52.148.87 (Sun, 21 Mar 1999 00:07:36 MET DST) Organization: Pinguin online User-Agent: slrn/0.9.5.4 (UNIX) NNTP-Posting-Date: Sun, 21 Mar 1999 00:07:36 MET DST Newsgroups: news.software.readers