🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #54234

Re: slrn-0957 customization of the header in article mode

#54234
From: John E. Davis
Date: Wed, 17 Nov 1999 00:00
54 lines
2033 bytes
On 15 Nov 1999 19:21:05 GMT, Sven Guckes <guckes@math.fu-berlin.de>
wrote:
>I want to see header like this:
>
>	From: 
>	Reply-To: 
>	Newsgroups: 
>	Subject: 
>	Date: 
>	Message-ID: 
>	X-Mailer: 

I think that you can use a macro that rearranges the header lines via
the functions `article_as_string' and `replace_article' article
functions.  The following code fragment illustrates the essentual
ideas.  You need slang 1.3.X for this.

define sort_article_header ()
{
   variable header, body, article;

   article = article_as_string ();

   % article = header\n\nbody
   variable i = is_substr (article, "\n\n");
   header = article[[0:i-1]];
   body = article[[i:]];
   
   % Now remove continuation lines from the header
   while (str_replace (header, "\n ", " "))
     header = ();
   while (str_replace (header, "\n\t", " "))
     header = ();

   % Now convert the header, which is currently a string, to an 
   % array of strings
   
   header = strtok (header, "\n");
   
   % Now manipulate the array of strings.  For example, here
   % I am going to sort them   
   i = array_sort (header);      % slang 1.3.x required!
   header = header[i];
   
   % Now join the header to the body
   
   header = strjoin (header, "\n");
   article = strcat (header, "\n", body);
   
   % Now replace the selected article with this
   replace_article (article);
}

Technical Details
Message-ID: <slrn8336s8.3mp.davis@mygir.davis.net>
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
References: <80pmf1$154oi$2@fu-berlin.de>

Show Full Headers
Complete Article Headers
Message-ID: <slrn8336s8.3mp.davis@mygir.davis.net>
Subject: Re: slrn-0957 customization of the header in article mode
Date: Wed, 17 Nov 1999 00:00:00 +0000
From: davis@space.mit.edu (John E. Davis)
References: <80pmf1$154oi$2@fu-berlin.de>
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: 549651821
Organization: Center for Space Research
User-Agent: slrn/0.9.5.7 (UNIX)
Newsgroups: news.software.readers