<<< Date Index >>>     <<< Thread Index >>>

Best way to handle DOS newlines



I occasionally get emails generated from a web application here at work
that uses DOS/Windows newlines instead of Unix ones.  All the text
shows up as one large line interspersed with ^M^M's.  I'd like to
figure out a good way to:

  1. Correct this in the pager view of the message.
  2. Correct this prior to the message being passed to my editor (vim)
     for quoting.

Currently I am resolving 1 by using the following message-hook:

  message-hook '~f ChangeControl.System@xxxxxxxx' 'set display_filter="sed -f 
~/bin/fix_m.sed"'

Where fix_m.sed strips out the ^M's and replaces them with my preferred
newlines.

However, if I hit reply to this message, everything shows up in vim in
the original format -- ie with the ^M's all intact and everything on
one line.

I can correct this from wtihin vim, but I'd prefer it all be automated.

I tried a reply-hook similar to my message-hook above, but had no
success.

Any suggestions?

Ray