Presently my mailcap calls a script to dumptext using a variety
of viewers.  The extra level of abstraction makes it easier to do
things like detect the terminal width, so it looks something like
this:

text/html; dumptext w3m %s ; nametemplate=%s.html ; copiousoutput ; test=which 
w3m >/dev/null 2>&1

and dumptext handles stuff like:

w=$({ stty size </dev/tty || echo '24 80'; } | cut -d' ' -f2)
w=$((w - 5))
w3m -cols $w -o frame=1 -o graphic_char=1 -o \
    ignore_null_img_alt=1 -o color=0 -o follow_locale=1 -dump "$@"

There's a little more to it than that because dumptext supports
multiple viewers, not just w3m, but you get the idea.

The only problem with this is that I'd like my quoted replies to
be constrained to 80 columns, even if I'm viewing messages in
a larger terminal.

Can anybody here dream up a way to let dumptext know that it's
being called as a result of <reply> instead of inline viewing?

Thanks,
Aron

Reply via email to