Article View: news.software.readers
Article #123624Re: [OT] slrn script (WAS) ATTN Luu Tran, author of X-News ...
From: Walter Dnes
Date: Mon, 21 Apr 2003 17:41
Date: Mon, 21 Apr 2003 17:41
66 lines
4199 bytes
4199 bytes
On Sat, 19 Apr 2003 03:00:06 GMT, SINNER, <99nesorjd@gates_of_hell.INVALID> wrote:
> While strolling through news.software.readers, Blinky the Shark was overheard plotting:
> >
> > If you had any, we might have seen it by now.
> >
>
> nb: Would you consider sharing that macro that edits the quote marks, it
> makes it look really clean /me likes :)
I've got a few that might be of interest. There'e some perl in them.
Here they are. *IMPORTANT*
1) These work when vim is invoked with "-N", the non-vi-compable mode
2) Where you see "^M", type <CTRL-V><CTRL-M> in the mapping
map <F12> :'a,.s/^/> /^M
- This one puts "> " in front of a range of lines. It does not wrap
or reformat the lines. Go to one end of the range of lines, and
type "ma" (without the quotes) to mark-a. Go to the other end of
the range and hit <F12>
map <F10> gq'a
- This one reformats a range of lines to default margins. "ma" at
one end and <F10> at the other end
map <F9> !'a/home/waltdnes/bin/q/q0^M
- This one takes a range of lines with *ONE LEVEL OF QUOTES*, and
reformats it *AND RESTORES THE QUOTES*. This is beyond mere vim;
I had to use perl. Here's /home/waltdnes/bin/q (replace with the
appropriate name for your home dir. Does "~" work here ?)
-rwx------ 1 waltdnes users 57 Mar 29 17:20 q0
-rwx------ 1 waltdnes users 145 Mar 29 17:20 q1
-rwx------ 1 waltdnes users 55 Mar 29 17:20 q2
Here's q0
#!/bin/bash
/home/waltdnes/bin/q/q1|fmt -w71|/home/waltdnes/bin/q/q2
Here's q1
#!/usr/bin/perl -w
use strict;
my $line = "";
while (<STDIN>)
{
$line = $_;
if ($line eq ">\n"){$line = "\n"};
$line =~ s/^> //;
print $line;
};
Here's q2
#!/usr/bin/perl -w
while (<STDIN>) {print "> " . $_;};
A short explanation. q0 is a shell script
- q0 invokes q1, a perl script that strips off the leading quotes
- q0 pipes the output from q1 to "fmt -w71" which reformats the text
- q0 pipes the reformatted text to q2, a perl script that sticks
leading "> " in front of each line
--
Walter Dnes <waltdnes@waltdnes.org>
Email users are divided into two classes;
1) Those who have effective spam-blocking
2) Those who wish they did
Technical Details
Message-ID:
<b81agn$5brlj$2@ID-146822.news.dfncis.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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news-feed1.de1.concert.net!fu-berlin.de!uni-berlin.de!ip185-165.tor.istop.COM!not-for-mailReferences:
<vakb8v4h01j9fp0rbkc96tu6ff6lqfe949@4ax.com> <3e95d5e4$0$2233$e4fe514c@dreader6.news.xs4all.nl> <3e960cef$0$6373$892e7fe2@authen.yellow.readfreenews.net> <3e96a364$0$147$e4fe514c@dreader8.news.xs4all.nl> <b7fni8$ghte$1@ID-51796.news.dfncis.de> <3e9c2b13$0$127$e4fe514c@dreader4.news.xs4all.nl> <slrnb9oil9.8fk.no.spam@dora.blinkynet.net> <ed4um-6nv.ln1@news.gates_of_hell.INVALID> <slrnb9ouop.8nt.no.spam@dora.blinkynet.net> <3e9e938a$0$2240$e4fe514c@dreader6.news.xs4all.nl> <slrnb9u6ai.2v2.no.spam@dora.blinkynet.net> <3ea04b41$0$146$e4fe514c@dreader9.news.xs4all.nl> <slrnba0ll4.80o.no.spam@dora.blinkynet.net> <URs9361E3E10A18845FRD678abg6s2ee5G@64.159.1.253> <slrnba0pnr.8up.no.spam@dora.blinkynet.net> <URs9361EE416635045FRD678abg6s2ee5G@64.159.1.253> <slrnba0t66.9b9.no.spam@dora.blinkynet.net> <URs936264527C545FRD678abg6s2ee5G@64.159.1.253> <slrnba1cse.2er.no.spam@dora.blinkynet.net> <fmq6n-d5u.ln1@news.gates_of_hell.INVALID>Show Full Headers
Complete Article Headers
Message-ID: <b81agn$5brlj$2@ID-146822.news.dfncis.de> Subject: Re: [OT] slrn script (WAS) ATTN Luu Tran, author of X-News ... Date: Mon, 21 Apr 2003 17:41:43 +0000 From: Walter Dnes <waltdnes@waltdnes.org> References: <vakb8v4h01j9fp0rbkc96tu6ff6lqfe949@4ax.com> <3e95d5e4$0$2233$e4fe514c@dreader6.news.xs4all.nl> <3e960cef$0$6373$892e7fe2@authen.yellow.readfreenews.net> <3e96a364$0$147$e4fe514c@dreader8.news.xs4all.nl> <b7fni8$ghte$1@ID-51796.news.dfncis.de> <3e9c2b13$0$127$e4fe514c@dreader4.news.xs4all.nl> <slrnb9oil9.8fk.no.spam@dora.blinkynet.net> <ed4um-6nv.ln1@news.gates_of_hell.INVALID> <slrnb9ouop.8nt.no.spam@dora.blinkynet.net> <3e9e938a$0$2240$e4fe514c@dreader6.news.xs4all.nl> <slrnb9u6ai.2v2.no.spam@dora.blinkynet.net> <3ea04b41$0$146$e4fe514c@dreader9.news.xs4all.nl> <slrnba0ll4.80o.no.spam@dora.blinkynet.net> <URs9361E3E10A18845FRD678abg6s2ee5G@64.159.1.253> <slrnba0pnr.8up.no.spam@dora.blinkynet.net> <URs9361EE416635045FRD678abg6s2ee5G@64.159.1.253> <slrnba0t66.9b9.no.spam@dora.blinkynet.net> <URs936264527C545FRD678abg6s2ee5G@64.159.1.253> <slrnba1cse.2er.no.spam@dora.blinkynet.net> <fmq6n-d5u.ln1@news.gates_of_hell.INVALID> 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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news-feed1.de1.concert.net!fu-berlin.de!uni-berlin.de!ip185-165.tor.istop.COM!not-for-mail Newsgroups: news.software.readers Lines: 65 Reply-To: waltdnes@waltdnes.org NNTP-Posting-Host: ip185-165.tor.istop.com (66.11.165.185) X-Trace: fu-berlin.de 1050946903 5631667 66.11.165.185 (16 [146822]) User-Agent: slrn/0.9.7.4 (Linux)