Article View: news.software.readers
Article #137862Re: [slrn] wrap html posts
From: Thomas Schultz
Date: Fri, 21 Nov 2003 11:27
Date: Fri, 21 Nov 2003 11:27
48 lines
3008 bytes
3008 bytes
* Steve [2003-11-21 03:15] :
> On Thu, 20 Nov 2003 17:24:11 -0500, Bill Marcum wrote:
[...]
>> Resize your terminal to 80 characters wide.
> Yeah, Yeah, so I guess you don't have a solution either?
If you really want to wrap after 80 characters in a wider terminal,
you can do this using a macro (get current article text with
read_article_as_string, replace it after processing with
replace_article). You can either write the logic to do the wrapping
yourself, or you can use an external program like fold(1).
Actually, the following macro (the part between the #v+/#v- marks)
should already do what you want:
#v+
define display_filter ()
{
variable filter = "fold -s";
variable tempfile = strcat(getenv("HOME"),"/.slrn-display-article");
variable fp = popen (filter + " > " + tempfile, "w");
if (fp == NULL) verror ("Unable to open %s", filter);
if ((-1 == fputs (article_as_string(), fp)) or
(-1 == fclose (fp)))
verror ("Error writing to %s", filter);
variable buf;
variable article;
fp = fopen (tempfile, "r");
if (fp == NULL) verror ("fopen %s failed", tempfile);
article = strjoin (fgetslines (fp),"");
if (-1 == fclose (fp))
verror ("Error closing %s", tempfile);
if (-1 == remove (tempfile))
verror ("Error removing %s", tempfile);
replace_article(article);
}
!if (1 == register_hook("read_article_hook", "display_filter"))
error ("Could not register display_filter for read_article_hook");
#v-
--
Thomas Schultz <tststs@gmx.de> News on slrn: http://slrn.sf.net/news.html
.-----------------------------. [2003-08-25] Released slrn 0.9.8.0
| Home of the slrn newsreader | [2003-08-19] New slrn FAQ available
| http://slrn.sourceforge.net | [2003-07-31] First beta with offline reading
Technical Details
Message-ID:
<slrnbrrtl4.1q8.tststs@moonlight.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.20140922.mbox.gz!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!acb0d5f1.ipt.aol.COM!not-for-mailReferences:
<cfabpb.n5h.ln@127.0.0.1> <slrnbrikfd.1n1.tststs@moonlight.tststs.ddns.org> <oqmbpb.vh.ln@127.0.0.1> <bhrv81-s6d.ln1@don.localnet> <slrnbrr0qs.r43.Steve.D.Allen@barnyard.sweetpig.dyndns.org>Show Full Headers
Complete Article Headers
Message-ID: <slrnbrrtl4.1q8.tststs@moonlight.tststs.ddns.org> Subject: Re: [slrn] wrap html posts Date: Fri, 21 Nov 2003 11:27:32 +0000 From: Thomas Schultz <tststs@gmx.de> References: <cfabpb.n5h.ln@127.0.0.1> <slrnbrikfd.1n1.tststs@moonlight.tststs.ddns.org> <oqmbpb.vh.ln@127.0.0.1> <bhrv81-s6d.ln1@don.localnet> <slrnbrr0qs.r43.Steve.D.Allen@barnyard.sweetpig.dyndns.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.20140922.mbox.gz!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!acb0d5f1.ipt.aol.COM!not-for-mail Newsgroups: news.software.readers Organization: Pinguin online. Lines: 48 NNTP-Posting-Host: acb0d5f1.ipt.aol.com (172.176.213.241) X-Trace: news.uni-berlin.de 1069421258 58789215 172.176.213.241 (16 [152]) User-Agent: slrn/0.9.8.0 (Linux)