2 " Language: generic ChangeLog file
3 " Written By: Gediminas Paulauskas <menesis@delfi.lt>
4 " Maintainer: Corinna Vinschen <vinschen@redhat.com>
5 " Last Change: June 1, 2003
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
17 if exists('b:changelog_spacing_errors')
18 let s:spacing_errors = b:changelog_spacing_errors
19 elseif exists('g:changelog_spacing_errors')
20 let s:spacing_errors = g:changelog_spacing_errors
22 let s:spacing_errors = 1
26 syn match changelogError "^ \+"
29 syn match changelogText "^\s.*$" contains=changelogMail,changelogNumber,changelogMonth,changelogDay,changelogError
30 syn match changelogHeader "^\S.*$" contains=changelogNumber,changelogMonth,changelogDay,changelogMail
32 syn region changelogFiles start="^\s\+[+*]\s" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
33 syn region changelogFiles start="^\s\+[([]" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
34 syn match changelogColon contained ":\s"
36 syn region changelogFiles start="^\s\+[+*]\s" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
37 syn region changelogFiles start="^\s\+[([]" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
38 syn match changelogFuncs contained "(.\{-})" extend
39 syn match changelogFuncs contained "\[.\{-}]" extend
40 syn match changelogColon contained ":"
42 syn match changelogBullet contained "^\s\+[+*]\s" contains=changelogError
43 syn match changelogMail contained "<[A-Za-z0-9\._:+-]\+@[A-Za-z0-9\._-]\+>"
44 syn keyword changelogMonth contained jan feb mar apr may jun jul aug sep oct nov dec
45 syn keyword changelogDay contained mon tue wed thu fri sat sun
46 syn match changelogNumber contained "[.-]*[0-9]\+"
48 " Define the default highlighting.
49 " For version 5.7 and earlier: only when not done already
50 " For version 5.8 and later: only when an item doesn't have highlighting yet
51 if version >= 508 || !exists("did_changelog_syntax_inits")
53 let did_changelog_syntax_inits = 1
54 command -nargs=+ HiLink hi link <args>
56 command -nargs=+ HiLink hi def link <args>
59 HiLink changelogText Normal
60 HiLink changelogBullet Type
61 HiLink changelogColon Type
62 HiLink changelogFiles Comment
64 HiLink changelogFuncs Comment
66 HiLink changelogHeader Statement
67 HiLink changelogMail Special
68 HiLink changelogNumber Number
69 HiLink changelogMonth Number
70 HiLink changelogDay Number
71 HiLink changelogError Folded
76 let b:current_syntax = "changelog"