Bug#438477: syntax/mail.vim: incorrect parsing of mailEmail match group

martin f krafft madduck at debian.org
Fri Aug 17 09:59:49 UTC 2007


Package: vim-common
Version: 1:7.1-056+2
Severity: normal
Tags: patch upstream

The mail.vim syntax matching for 'syn match mailEmail' is wrong:

  - does not deal with umlaut characters, e.g. ä
  - does not handle capital letters
  - does not allow for spaces

My current solution is to use

  "\v[-./+=\"[:space:][:alnum:]]+\@[a-z0-9._-]+\a{2}"

instead, but that's problematic, since [[:alnum:]] depends on
LC_CTYPE, and unless that's set to a language locale with umlauts,
they won't be respected; however, listing all umlauts would also be
wrong.

Another possibility would be:

  \v(\"[^\"]+\"|[^[:space:][:punct:]][^[:space:]]*)\@...

which basically says either it's a quoted address, then take
anything between quotes, or take everything non-space after the
first non-space or non-punctuation character, leading up to the @.

I almost like the second better and even though I realise that it's
not enough to represent all email addresses[0], I feel that with
syntax highlighting, it's quite okay to shoot over the top a bit.

0. http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages vim-common depends on:
ii  libc6                         2.6.1-1    GNU C Library: Shared libraries

Versions of packages vim-common recommends:
ii  vim                          1:7.1-056+2 Vi IMproved - enhanced vi editor

-- no debconf information


-- 
 .''`.   martin f. krafft <madduck at debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20070817/f16cb545/attachment.pgp 


More information about the pkg-vim-maintainers mailing list