Package: vim
Version: 1:7.1.291-1
Severity: minor
Tags: patch

Hi,

I find that vim's detection of mbox (filetype "mail") files for syntax
coloring, etc. doesn't work when they are generated by Mozilla
Thunderbird, the reason being that in the From line preceding each
message, Thunderbird apparently puts a "-" rather than an email address.

Example header line in debian-private archive:

From [EMAIL PROTECTED] Tue Apr 01 09:36:16 2008

Example header line in my local mailbox generated by Icedove:

From - Wed Jan 02 08:44:14 2008

The attached, very minor patch to /usr/share/vim/vim71/scripts.vim
allows vim to also realize that Thunderbird's idiosyncratic headers
signal a file in mbox format.

Side note: This is not included in the patch, but also maybe "=~" on the
line changed by the diff should be changed to "=~#" since to the best of
my knowledge, the "From" is case-sensitive.

best regards,

-- 
Kevin B. McCarty <[EMAIL PROTECTED]>
WWW: http://www.starplot.org/
WWW: http://people.debian.org/~kmccarty/
GPG: public key ID 4F83C751
--- scripts.vim.orig	2008-04-09 14:08:05.000000000 -0700
+++ scripts.vim	2008-04-09 14:09:29.000000000 -0700
@@ -168,7 +168,7 @@
     set ft=zsh
 
   " ELM Mail files
-  elseif s:line1 =~ '^From [a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\= .*[12][09]\d\d$'
+  elseif s:line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .*[12][09]\d\d$'
     set ft=mail
 
     " Mason

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to