Quoting Peter Whiting <[EMAIL PROTECTED]> on Fri, Feb 08 14:01: > On Fri, Feb 08, 2002 at 02:35:27PM -0500, Omen Wild wrote: > > > > # Wrap long lines > > macro pager ~@won "<enter-command>set display_filter=\"par 73qe\"; macro pager >\\cw ~@woff\n<display-toggle-weed><display-toggle-weed>" > > macro pager ~@woff "<enter-command>set display_filter=''; macro pager \\cw >~@won\n<display-toggle-weed><display-toggle-weed>" > > macro pager \cw ~@won "Toggle line wrapping"
[ snip ] > trick is to store the file so you can pump it twice through (sed|formail) > and then recombine the output. I wanted to try this so I whipped up the attached perl script. It reads in the message from stdin, writes the body to a file, has par reformat the body, and then prints out the headers (unchanged) and the body. par does nasty things to the GPG verification lines, but at least the headers are untouched. ;-) Omen -- "What is this talk of 'release'? Klingons do not make software 'releases'. Our software 'escapes,' leaving a bloody trail of designers and quality assurance people in its wake."
#! /usr/local/bin/perl -w use strict; use Data::Dumper; use POSIX qw/tmpnam/; my $PROGRAM = ($0 =~ /^(.*\/){0,1}(.+)/)[1]; my $name = tmpnam(); END { if ( -f $name) { unlink($name); } } my @headers; my @body; while (my $line = <>) { if(! @body && $line !~ m/^$/) { push(@headers, $line); } else { push(@body, $line); } } open(BODY, ">$name") or die "$PROGRAM: unable to open tmpfile '$name': $!\n"; print BODY @body; close(BODY); my $fmt = `cat $name | par 72qe`; print @headers, "\n", $fmt;
msg24374/pgp00000.pgp
Description: PGP signature