Thank you very much for this extensive feedback and for sharing your
scripts. I tried to set them up and make them work. I come to a stage
where I get the following error (which I seem unable to interpret):
mhnshow: option -c not recognized
usage: %s [-N prog] [-HDsw] arg [... arg] [-show]
filterproc: exit 2
writer process: signal 13 (Broken pipe: 13)
/usr/local/Cellar/nmh/1.7.1_1/libexec/nmh/mhl: exit 1
It seems to come about when I try to use your format filter. Would this
ring any bell? Or any other suggestions?
In any case many thanks,
Marc
>>> Chris Siebenmann said:
>> > 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="--fmt
proc",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
>>
Marc Baaden
--
Dr. Marc Baaden - Institut de Biologie Physico-Chimique, Paris
mailto:[email protected] - http://www.baaden.ibpc.fr
FAX: +33 15841 5026 - Tel: +33 15841 5176 ou +33 609 843217
_______________________________________________
Exmh-users mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/exmh-users