#
# - Put the path to this program in your .mh_profile under formatproc:
#
-# formatproc: replyfilter
+# formatproc: replyfilter
#
-# - Create a mhl reply filter that consists of the following line:
+# or invoke repl with "-fmtproc replyfilter".
#
-# body:nocomponent,format,nowrap,formatarg="%(trim{content-type})%(putstr)",formatarg="%(trim{content-transfer-encoding})%(putstr)",formatarg=">"
+# - Create an mhl reply filter that consists of the following line:
+#
+# body:nocomponent,format,nowrap,formatarg="%(trim{content-type})%(putstr)",formatarg="%(trim{content-transfer-encoding})%(putstr)",formatarg=">"
+#
+# By default, repl will look for the mhl reply filter by the name
+# "mhl.reply", but it will look elsewhere if the -filter switch is given.
#
# To decode this a bit:
#
# component prefix of ">" as a quote character, but we're
# going to have replyfilter do that).
# nowrap - Don't wrap lines if they exceed the column width
-# formatarg - Arguments to fmtproc. The first argument is the value of
-# the Content-type header; the second is the value of the
+# formatarg - Arguments to formatproc. The first argument is the value
+# of the Content-type header; the second is the value of the
# Content-Transfer-Encoding header. The last "formatarg"
# is used as your quoting prefix. Replace it with whatever
# you want.
$maxcolwidth = 78;
#
-# Out HTML converter program & arguments
+# Out HTML converter program & arguments. charset will be appended
#
@htmlconv = ('w3m', '-dump', '-cols', $maxcolwidth - 2, '-T', 'text/html',
- '-O', $outcharset);
+ '-O', $outcharset, '-I');
die "Usage: $0 Content-type content-transfer-encoding quote-prefix\n"
# or base64 to feed it into a formatting filter.
#
-sub process_text (*$$;$)
+sub process_text
{
my ($input, $encoding, $charset, $boundary) = @_;
my $text, $filterpid, $prefixpid, $finread, $finwrite;
# Filter HTML through a converter program
#
-sub process_html (*$$;$)
+sub process_html
{
my ($input, $encoding, $charset, $boundary) = @_;
my $filterpid, $prefixpid, $finread, $finwrite;
# Exec our converter
#
- exec (@htmlconv) ||
- die "Unable to exec $filterprogram: $!\n";
+ my @conv = (@htmlconv, $charset);
+ exec (@conv) ||
+ die "Unable to exec $htmlconv[0]: $!\n";
} else {
die "Fork for $htmlconv[0] failed: $!\n";
}
# Decide what to do, based on what kind of content it is.
#
-sub process_part (*$$$$;$)
+sub process_part
{
my ($input, $content_type, $encoding, $charset, $boundary, $name) = @_;
my ($type, $subtype) = (split('/', $content_type, -1), '');
# the content of this part
#
-sub process_multipart ($$$)
+sub process_multipart
{
my ($input, $subtype, $boundary) = @_;
my $altout;
if ($subtype eq 'alternative' && ! defined $altout &&
$type eq 'text/plain') {
- $altout = 1;
+ $altout = 1;
}
#
# "Eat" a MIME part; consume content until we hit the boundary or EOF
#
-sub eat_part ($$)
+sub eat_part
{
my ($input, $boundary) = @_;
my $ret;
# Return the decoder subroutine to use
#
-sub find_decoder ($)
+sub find_decoder
{
my ($encoding) = @_;
}
}
-sub null_decoder ($)
+sub null_decoder
{
my ($input) = @_;
# Match a line against the boundary string
#
-sub match_boundary($$)
+sub match_boundary
{
my ($line, $boundary) = @_;