Ton Boelens | 1 May 20:58 2005
Picon

How to copy with badly wrapped lines in pager

Hi,

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.

Sorry if this has been asked before, but I have searched the archives
and did not find anything.

Regards,

Ton

--

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

Bob Proulx | 4 May 08:09 2005

Re: How to copy with badly wrapped lines in pager

Ton Boelens 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.

If they have been quoted "> > " and are wrapped badly you are
basically unable to fix it.  But if it is just long lines you can
correct for the content-type of outlook.

Use ^E to edit the content type, append to the end of the string ";
format=flowed" and that will correct to the formatting what outlook
should have set it to when it sent the message.

Bob

David Champion | 4 May 09:04 2005

Re: How to copy with badly wrapped lines in pager

* On 2005.05.01, in <20050501185810.GA6825 <at> pc1>,
*	"Ton Boelens" <linux <at> tonboelens.nl> 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. :)

#!/usr/bin/env perl
##
## a display filter for mutt.
##
(Continue reading)

Thomas Glanzmann | 4 May 09:15 2005
Picon
Picon

Re: How to copy with badly wrapped lines in pager

Hello,
in praxis I call 'edit' on this message. Type something like gqap in my
vim, which reformats it into human readable, save it and enjoy the result.

	Thomas

Ton Boelens | 4 May 11:22 2005
Picon

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 <at> pc1>,
> *	"Ton Boelens" <linux <at> tonboelens.nl> 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'
(Continue reading)

Toby | 4 May 11:40 2005
Picon

Re: How to copy with badly wrapped lines in pager

David Champion wrote:
> For this kind of scenario I've created a display-filter that I
> activate with a macro

Quite interesting trick!  Here are my results trying to apply it.

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

Problem #1: <display-message> doesn't exist in the pager. 
(I'm using Mutt from Debian testing, apparently 1.5.6+20040907i CVS)

Solution: exit the message and the re-enter it:

macro pager \Cr ":set display_filter=display-filter\nq\n:unset display_filter\n"
                                                     ^

(lol.. cue readable vs. short macro lines flamewar :)

> My $PARINIT is set: PARINIT="rTbgqR B=.,?!_A_a Q=_s>|+" .  You'll want
> something similar if you use that filter.

Alright, so I did this:

	  #!/usr/bin/perl
	  
	  use strict;
	  
	  while (<STDIN>) {
(Continue reading)

David Champion | 4 May 18:08 2005

Re: How to copy with badly wrapped lines in pager

* On 2005.05.04, in <20050504092252.GA23932 <at> pc1>,
*	"Ton Boelens" <linux <at> tonboelens.nl> wrote:
> 
> 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>"

I think this problem is the same as Toby mentioned.  My mistake; there's
no display-message in pager mode.  I meant index. :)

But you can modify the macro to work from pager, too, as Toby did.

> 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?

Sed would be tricky, but possible -- but also not very good at the task.
Par uses intelligent algorithms to reflow text, but it would be difficult
to make sed do much more than rewrap lines at 72 columns or something.
If you're happy with that, then I suggest fmt instead -- it's standard
across all Unixes I've seen in the last 10 years or so.  But par will get
you good results in perhaps more different cases.

You probably can do something with vim, but I don't know -- I don't use
it.  I gather that a lot of par's features have been absorbed into vim's
gq stuff.  I have a hunch that vim got it directly from par, at least in
spirit, because "gq" is the essential part of $PARINIT that does most of
the work.  I suspect par has more features, but that vim has all of the
most common/useful ones.

(Continue reading)

Sergio Dominguez | 5 May 12:50 2005
Picon

Delete text quoted more than once

 Hi all,

 I have been thoroughly looking for something to do this, but I have not found anything. Is there a way not to
include in the reply to an email the part of the text which is already quoted with > ?? I know I can edit it
manually, but it would be great if the quoted text on a reply could be limited just to the one
 of the last email.

 Thanks,

 Sergio

--

-- 
Justice always prevails ... three times out of seven!
		-- Michael J. Wagner

Michael Kjorling | 5 May 13:37 2005

Re: Delete text quoted more than once

On 2005-05-05 11:50 +0100, sergio <at> skynet.ie wrote:
> Is there a way not to include in the reply to an email the part of the
> text which is already quoted with > ??

Set Mutt's `editor' setting to a script that does what you want (using
sed, for example) and passes the result to your editor of choice.

Just be sure to keep the original file name, or Mutt won't find the
message text.

--

-- 
Michael Kjörling, michael <at> kjorling.com - http://michael.kjorling.com/
* ASCII Ribbon Campaign: Against HTML Mail, Proprietary Attachments *
* No bird soars too high if he soars with his own wings. -*- SM0YBY *
*** Software patents hinder progress - see http://swpat.ffii.org/ ***

Hendrik Mangels | 5 May 13:43 2005
Picon
Picon

Re: Delete text quoted more than once

Michael Kjorling (2005-05-05, 11:37):
> Set Mutt's `editor' setting to a script that does what you want (using
> sed, for example) and passes the result to your editor of choice.

No need for a script at all, your editor of choice should be
capable of that job itself... At least the case you are using a
editor that even deserves the name ;-)

Hendrik


Gmane