Re: Quoted Printable - mutt and vim

2010-06-27 Thread Gary Johnson
On 2010-06-25, George Davidovich wrote:
 I'm getting multipart/alternative emails from a Yahoo user that have a
 text/plain part like the following (modified):
 
  32 Content-Type: text/plain; charset=iso-8859-1
  33 Content-Transfer-Encoding: quoted-printable
  34 
  35 George=A0=A0-=A0=A0 Lorem ipsum dolor sit amet, consectiscing elit=
  36  Fusce sodales, sapien eu consectetur eleifend, nibh lles=A0=A0=A0=
  37 diam=0A=0ARegards.=0A=0A=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  41 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  43 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  44 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  46 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  47 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  48 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  49 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
  50 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
 
 As I understand it, A0 represents the non-breaking space character.
 Mutt displays the message correctly, but in vim, the character appears
 as a pipe symbol.  And, as you can tell, there's a whole lot of them.
 
 My questions, then, are:
 
   1. Is there a mutt configuration setting I'm missing that causes vim
  to get the A0 character?  Maybe this behaviour is a feature? ;-)

I don't think it's mutt; I think it's the sender's mail user agent.
I see this a lot, but only from certain senders or certain lists.

   2. As a workaround, how do I search/replace non-printable characters
  in vim?

Here is my solution, from my ~/.vimrc:

set isprint+=160 Add nbsp (0xa0) to the set of printable
 characters so that it will be displayed
 as the single character space rather
 than as the pair | .  This seems to be
 supported by xterm and gvim on Unix and
 by Cygwin's rxvt on Windows.  It is
 already set for gvim on Windows.

Regards,
Gary



Re: folder-hook doesn't work anymore with gmail

2010-06-27 Thread Marco Giusti
On Fri, Jun 25, 2010 at 08:50:32AM +0200, Marco Giusti wrote:
 hi mutt users,
 
  time ago i set folder hooks to set different macros for different
 folders, in particulary gmail's imap. now these hooks don't work
 anymore. i controlled it twice and i'm preatty sure they worked for a
 while: when i change folder and enter gmail's inbox, folder variable is
 still set to '~/mail' and macros are not changed.

I found the error and it's also and old bug[1] closed as won't fix.
Before the hook I had a comment line ending with a backslash, like this
one.

# \
folder-hook . 'push collapse-all'

This is not exactly what I expect comments work. Quoting bash manual
page:

... a word beginning with # causes that word and all remaining
characters on that  line to be ignored.

m.


[1] http://dev.mutt.org/trac/ticket/1561


-- 
Dalle virtù che si esigono in un domestico, l'Eccellenza Vostra conosce molti
padroni degni d'esser servitori?
-- Pierre Augustin Caron de Beaumarchais


Re: Add header automatically

2010-06-27 Thread Tim Gray

On Jun 27, 2010 at 12:50 PM -0400, Ed Blackman wrote:
I have my $editor set to a Perl script that manipulates the incoming 
message in various custom ways before handing it off to my real editor. 
Adding a new header would be trivial.


The only disadvantage is that I have lost the Aborted unmodified message 
detection, which I could fix if I ever was bothered enough to figure out 
how mutt detects unmodified messages (file timestamp?)


I do something similar with a python script.  I got around the problem you 
mention above by making two temp copies of the message file.  I then send 
one copy to my editor for writing the message.  After the editor returns, I 
compare the two temp copies.  If they are the same, I delete them and exit. 
The original file from mutt has never been touched at this point and it 
picks up on the fact that it's unmodified and aborts.  If the two temp 
copies are different, remove the original mutt file and replace it with the 
modified file.  Then remove the temp files.


I'm sure there's an easier way to do this.  I'm also sure you could do it 
with only one temp file and not the two, but when I wrote the script the 
other year, I had some reason for doing it the way I did.  Oh yeah, I have a 
step that strips signatures before I start editing, so I can't compare to 
the file directly out of mutt, since that can still have a sig.


It would be easy to add a blank attachement line, and then after you get 
done editing, strip it out if it had a dummy value, like 'blank.txt'. 
Personally, I find it easy enough to hit the 'a' key in the compose screen 
and just drag my file into my terminal.  OS X picks up on the file path and 
pastes it in for you.


Tim