> NB: in general if readers on this list have customized variants of 
> scripts/commands for replying/quoting, and are willing to share, I'd
> be most interested.

 Getting good quoted replies in NMH is unfortunately a complex art
(that NMH makes more difficult than necessary for reasons). You can get
quoted bodies with 'repl -format', but (as you've found out) this quotes
the body in its raw form, before MIME decoding. To get MIME decoded
quoted bodies, you need to use a format filter that tells NMH to use a
formatproc and then have a formatproc that does the right thing.

 Format filters are documented in 'man mhl'. My format filter is:

        body:component="> 
",nowrap,offset=0,compwidth=0,format,formatarg="--fmtproc",formatarg="%(trim{content-type})%(putstr)",formatarg="%(trim{content-transfer-encoding})%(putstr)"

 This runs my .mh_profile 'formatproc' with three arguments:
        <program> --fmtproc "<content-type>" "<c-t-encoding>"

(The last two may be blank for some simple messages)

 The reason I supply the extra two arguments is that NMH makes life
difficult for us here. The ideal situation would be that your formatproc
is invoked in exactly the same way as your showproc, so that if you have
a custom showproc that does things you like, you can directly reuse it.
Unfortunately, NMH invokes your formatproc with only the *body* of the
email you're replying to, without the headers (including without the
MIME headers that will tell you what the body means, which is why I have
to pass them as command line arguments).

 For years I've had a custom showproc that I use when I'm using command
line NMH (exmh does its own handling), which is a combination of a
Python (2) program to do the formatting and a front-end script to run
it through a suitable pager environment. My formatproc reuses this
Python program, with some additional code in the program to make it
work.  Well, there are actually a few more pieces, because it's gotten
intricate (and hacked) over the years. Interested parties can find all
of the pieces at
        https://www.cs.toronto.edu/~cks/software/exmh/

The 'mhnshower' script is my showproc; the 'mhnshowfmt' script is my
formatproc. Various things assume that /u/cks/bin/mh is where they can
find other things, and some of this could be simplified. The mhnshow.py
program is the (Python 2) main program used in the showproc/formatproc,
and is where all of the actual formatting happens.

(How it formats MIME messages may not be to everyone's tastes; it's
explicitly designed to produce a stream of text with no pauses to
ask questions about how you want to handle odd parts and so on.)

 I have my exmh customized so that I can reply with the original
message quoted, and if I do that it will run the original message
through this quoting pipeline. I'm not sure if the way I'm doing
it today is a good way, but it winds up binding Key-R to
            Bind_Key $w <Key-R> {Msg_Reply -cc to -cc cc -format -filter 
reply-inclusion}

(My exmh is a bit hacked, just like my NMH environment.)

        - cks

_______________________________________________
Exmh-users mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/exmh-users

Reply via email to