[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
Single Page
Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: 05.15 How can I make sense of the replcomps file?
Next Document: 05.17 Can I have aliases include aliases?
-
Search the FAQ Archives
Single Page
Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: 05.15 How can I make sense of the replcomps file?
Next Document: 05.17 Can I have aliases include aliases?
05.16 How can I convert quoted-printable to 8bit in quoted text in replies?
Date: 22 Aug 1995 10:42:07 +0200
The idea behind the solution is that I need mhn to store the
contents of the mail in the native iso8859-1 format somewhere. I did
this by creating a custom editor that is invoked when I reply to a
message. This editor extracts the body of the message (sorry, no
multipart stuff), indents it with '> ', appends it to the draft
message and invokes the ordinary editor on it. Here are the details:
`isorepl' is a symbolic link from my $HOME/bin-directory to `repl'.
In my .mh_profile I added the following two lines:
isorepl: -form isoreplcomps -editor isoextract
isoextract-next: vi
The isoreplcomps file in my Mail-directory contains:
%(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\
%<(nonnull)%(void(width))%(putaddr To: )\n%>\
%(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\
%<(nonnull)%(void(width))%(putaddr cc: )\n%>\
%<{fcc}Fcc: %{fcc}\n%>\
%<{subject}Subject: Re: %{subject}\n%>\
%<{date}In-reply-to: Your message of "\
%<(nodate{date})%{date}%|%(pretty{date})%>."%<{message-id}
%{message-id}%>\n%>\
--------
#<text/plain; charset=iso-8859-1
%<{message-id}In message %{message-id} %>\
%<{from}%(friendly{from}) writes%|You write%>:
This is a "Usenet-like" quoting style. Modify to suit your own
taste. This form will setup the proper header, as well as the first
line of the new message (In <mmmmbbbb> nnnn writes etc.).
The first editor, `isoextract', looks like this:
#!/bin/sh
#
# Called from within repl where the "editalt" variable is valid
#
# Point to a special MHN configuration file (save old one)
OLDMHN="$MHN"
MHN=$HOME/`mhparam Path`/isoquotemsg
export MHN
# Extract message body to "native" format (should be iso-8859-1)
# > More bla bla.
mhn -file "$editalt" -store >> $1 2>/dev/null
MHN="$OLDMHN"
myname=`basename $0`
next=`mhparam ${myname}-next`
if [ "x$next" != "x" ]; then
exec $next "$@"
fi
`isoquotemsg' has just one rule; how mhn should store a text message.
mhn-store-text: |sed -e 's/^[ ]*$//' \
-e 's/^\([>|]\)\(.*\)$/>\1\2/' \
-e 's/^\([^>|].*\)$/> \1/'
This tells mhn to pipe the message to stdout, where the sed commands
will do the reformatting/quoting. (Note: the first pair of square
brackets contains a space and a tab.)
So, when I do a `isorepl' to a message, `repl' will create the draft
message with the proper headers (based on the `isoreplcomps' format
file), fire off its first editor, `isoextract', with the name of the
draft file as its parameter. `isoextract' then invokes mhn in a
suitable environment, tells it that it is to use the file $editalt
as its source, and orders it to store the contents. The store-text
rule in the custom MHN-file tells it to just pipe the message (in
native iso8859-1 form) through a small set of sed commands, and
`isoextract' uses the normal shell construct to append the result to
the draft file. Then, if there's defined a `isoextract-next' entry
in the .mh_profile, isoextract exec's this editor.
Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: 05.15 How can I make sense of the replcomps file?
Next Document: 05.17 Can I have aliases include aliases?
Single Page
[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
Send corrections/additions to the FAQ Maintainer:
Bill Wohler <wohler@newt.com>
Last Update October 22 2009 @ 05:26 AM