🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.mh
Article #1937

Getting 'repl' to indent lines

#1937
From: James T Perkins
Date: Thu, 14 Dec 1989 16:51
54 lines
2373 bytes
Here's my answer, and it seems to work with the antiquated MH6.3
(Stephen Mulrine tested it for me) and my "Classic" MH5.1.  I suspect it
will work correctly on most pre-6.5 releases of MH, plus you can
configure it to do any kind of reformatting you'd like.  One word of
warning, though; it is incompatible with the use of mhl anywhere, since
it defines a different mhlproc.

So, without further ado:

In your .mh_profile place the following two lines:

	repl: -filter /dev/null
	mhlproc: /u/jamesp/sbin/repl.filter

The first line tells the repl command to filter the replied-to message
with "mhl", and to pass the format file "/dev/null" to mhl on the
command line.  The second line tells mhl to use
/u/jamesp/sbin/repl.filter instead of the normal mhl.

Here is my repl.filter program, a shell script:

	:
	exec /bin/sed -n '1,/^$/d;s/^./> &/;p'

Note that it ignores all the command-line arguments; it just takes what
repl gives it on its stdin and formats it.

The above sed command will delete all the header lines, and indent all
non-empty body lines with "> ".  The following:

	:
	exec /bin/sed -n '1,/^$/d;s/^/> /;p'

would delete all the header lines, and indent ALL body lines with "> ".
The following:

	:
	/bin/sed '1,/^$/d' | /usr/ucb/fmt | /bin/sed 's/^./> &/'

would delete all the header lines, format the body with fmt to 72
columns, and then indent all non-empty body lines with "> ".
Even more elaborate and ridiculous repl.filters will be left as an
exercise for the reader :-).

James, Classic MH User

 ___    ___   ___
|   \  / _ \ / __|  James T. Perkins, jamesp@dadla.wr.tek.com, (503)629-1149
| |> || |_| |\__ \  Tektronix, Dig Inst Div, DAS 9200 Software Integration
|___/ |_| |_||___/  MS 92-725, PO Box 4600, Beaverton, OR 97075

This package is sold by weight, not by volume.  Some settling of contents may
have occurred during shipping and handling.
Technical Details
Message-ID: <8912141651.AA00541@dadla.WR.TEK.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!dadla.wr.tek.COM!jamesp

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!dadla.wr.tek.COM!jamesp
From: jamesp@dadla.wr.tek.COM (James T Perkins)
Newsgroups: comp.mail.mh
Subject: Getting 'repl' to indent lines
Message-ID: <8912141651.AA00541@dadla.WR.TEK.COM>
Date: 14 Dec 89 16:51:02 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: "James T. Perkins" <jamesp@dadla.wr.tek.COM>
Organization: The Internet
Lines: 54