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

Re: How to copy with badly wrapped lines in pager



On Wed, May 04, 2005 at 02:04:22AM -0500, David Champion wrote:
> * On 2005.05.01, in <20050501185810.GA6825@pc1>,
> *     "Ton Boelens" <linux@xxxxxxxxxxxxx> wrote:

> > Sometimes, I receive mails from Outlook Express that are 'prewrapped'
> > at the wrong width and simply look awfull in my Mutt's pager :-)

> > Is there a way to 'rewrap' these messages automatically when they
> > arrive (I use Procmail) or to use some kind of display-filer to
> > resolve this? Set smart-wrap = yes does not do the trick.


> I don't like modifying incoming messages, and no filter is going to be
> reliable in all cases, so I hesitate to use a filter all the time.  For
> this kind of scenario I've created a display-filter that I activate with
> a macro:

> macro   pager   \Cr     "<enter-command>set 
> display_filter=\"display-filter\"<enter><display-message><enter-command>unset 
> display_filter<enter>" "Reflow formatting"

> When I get an unreadable message, I press ^R and it's made readable.
> (I have a ^X macro that rot-13s the text, which I use the same way.)


> Here is "display-filter".  It just presents the headers as they are
> and feeds the body to par(1).  It should be modified to stop at a
> .signature, but I don't care that much. :)

David,

Thanks for you reply. It works, but I get an error 'key not defined'
with the second part of the macro:

"{snip!}...<display-message><enter-command>unset display_filter<enter>"

If I remove the commands above from the macro, the filter works and I
can see the formatted text when I go back to the previous messages and
then back to the original message.

Also, the command par could be replaced by a sed command, or a
VIM-macro that does 'gqap', sends the output to STDOUT and then exits?

I am not sure if anyone has tried this?

Regards,

Ton

-- 
/ton
http://www.tonboelens.nl