annotate runtime/syntax/mail.vim @ 34259:70c1a9c6f41d v9.1.0070

patch 9.1.0070: CI: testsuite not run on M1 Mac Commit: https://github.com/vim/vim/commit/e93d5cadec6323d6be90f1ec29066441ffbc9477 Author: rhysd <lin90162@yahoo.co.jp> Date: Thu Feb 1 21:22:14 2024 +0100 patch 9.1.0070: CI: testsuite not run on M1 Mac Problem: CI: testsuite not run on M1 Mac Solution: Make it run on gh runners for M1, disable failing tests for now, until we figure the problem with the failings tests out (rhysd) closes: #13943 Signed-off-by: rhysd <lin90162@yahoo.co.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Feb 2024 21:30:03 +0100
parents 073a16d82b75
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Mail file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Previous Maintainer: Felix von Leitner <leitner@math.fu-berlin.de>
3224
8b8ef1fed009 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
4 " Maintainer: GI <a@b.c>, where a='gi1242+vim', b='gmail', c='com'
34204
073a16d82b75 runtime(mail): fix #13913 (#13917)
Christian Brabandt <cb@256bit.org>
parents: 34182
diff changeset
5 " Last Change: Thu 25 Jan 2024 10:34:02 AM EST
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
12 let s:cpo_save = &cpo
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
13 set cpo&vim
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
14
34182
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
15 syn spell toplevel
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
16
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " The mail header is recognized starting with a "keyword:" line and ending
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " with an empty line or other line that can't be in the header. All lines of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " the header are highlighted. Headers of quoted messages (quoted with >) are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " also highlighted.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " Syntax clusters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn cluster mailHeaderFields contains=mailHeaderKey,mailSubject,mailHeaderEmail,@mailLinks
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn cluster mailLinks contains=mailURL,mailEmail
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn cluster mailQuoteExps contains=mailQuoteExp1,mailQuoteExp2,mailQuoteExp3,mailQuoteExp4,mailQuoteExp5,mailQuoteExp6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " For "From " matching case is required. The "From " is not matched in quoted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " emails
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 301
diff changeset
30 " According to RFC 2822 any printable ASCII character can appear in a field
96cd8222a819 updated for version 7.1a
vimboss
parents: 301
diff changeset
31 " name, except ':'.
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
32 syn region mailHeader contains=@mailHeaderFields,@NoSpell start="^From .*\d\d\d\d$" skip="^\s" end="\v^[!-9;-~]*([^!-~]|$)"me=s-1 fold
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
33 syn match mailHeaderKey contained contains=mailEmail,@NoSpell "^From\s.*\d\d\d\d$"
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
34
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
35 " Nothing else depends on case.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
36 syn case ignore
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
37
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
38 " Headers in properly quoted (with "> " or ">") emails are matched
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
39 syn region mailHeader keepend contains=@mailHeaderFields,@mailQuoteExps,@NoSpell start="^\z(\(> \?\)*\)\v(newsgroups|x-([a-z\-])*|path|xref|message-id|from|((in-)?reply-)?to|b?cc|subject|return-path|received|date|replied):" skip="^\z1\s" end="\v^\z1[!-9;-~]*([^!-~]|$)"me=s-1 end="\v^\z1@!"me=s-1 end="\v^\z1(\> ?)+"me=s-1 fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
40
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
41 " Usenet headers
149d8b46404c updated for version 7.2a
vimboss
parents: 1125
diff changeset
42 syn match mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@NoSpell "\v(^(\> ?)*)@<=(Newsgroups|Followup-To|Message-ID|Supersedes|Control):.*$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
227
ef254e0f2365 updated for version 7.0063
vimboss
parents: 164
diff changeset
45 syn region mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@mailQuoteExps,@NoSpell start="\v(^(\> ?)*)@<=(to|b?cc):" skip=",$" end="$"
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
46 syn match mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@NoSpell "\v(^(\> ?)*)@<=(from|reply-to):.*$" fold
301
006e9c8a6a8a updated for version 7.0079
vimboss
parents: 230
diff changeset
47 syn match mailHeaderKey contained contains=@NoSpell "\v(^(\> ?)*)@<=date:"
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
48 syn match mailSubject contained "\v^subject:.*$" fold
301
006e9c8a6a8a updated for version 7.0079
vimboss
parents: 230
diff changeset
49 syn match mailSubject contained contains=@NoSpell "\v(^(\> ?)+)@<=subject:.*$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Anything in the header between < and > is an email address
301
006e9c8a6a8a updated for version 7.0079
vimboss
parents: 230
diff changeset
52 syn match mailHeaderEmail contained contains=@NoSpell "<.\{-}>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 7
diff changeset
54 " Mail Signatures. (Begin with "-- ", end with change in quote level)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
55 syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^--\s$" end="^$" end="^\(> \?\)\+"me=s-1 fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
56 syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps,@NoSpell start="^\z(\(> \?\)\+\)--\s$" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1 fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
57
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
58 " Treat verbatim Text special.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
59 syn region mailVerbatim contains=@NoSpell keepend start="^#v+$" end="^#v-$" fold
5340
22da5ab9aaa1 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3312
diff changeset
60 syn region mailVerbatim contains=@mailQuoteExps,@NoSpell keepend start="^\z(\(> \?\)\+\)#v+$" end="\z1#v-$" fold
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " URLs start with a known protocol or www,web,w3.
301
006e9c8a6a8a updated for version 7.0079
vimboss
parents: 230
diff changeset
63 syn match mailURL contains=@NoSpell `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]`
006e9c8a6a8a updated for version 7.0079
vimboss
parents: 230
diff changeset
64 syn match mailEmail contains=@NoSpell "\v[_=a-z\./+0-9-]+\@[a-z0-9._-]+\a{2}"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
34182
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
66 " Don't spell emojis
34204
073a16d82b75 runtime(mail): fix #13913 (#13917)
Christian Brabandt <cb@256bit.org>
parents: 34182
diff changeset
67 syn match mailEmoji contains=@NoSpell "\%#=2\v[\U1f300-\U1f64f\U1f900-\U1f9ff]"
34182
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
68
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " Make sure quote markers in regions (header / signature) have correct color
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match mailQuoteExp1 contained "\v^(\> ?)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match mailQuoteExp2 contained "\v^(\> ?){2}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match mailQuoteExp3 contained "\v^(\> ?){3}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match mailQuoteExp4 contained "\v^(\> ?){4}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match mailQuoteExp5 contained "\v^(\> ?){5}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match mailQuoteExp6 contained "\v^(\> ?){6}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
77 " Even and odd quoted lines. Order is important here!
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
78 syn region mailQuoted6 keepend contains=mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{5}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
79 syn region mailQuoted5 keepend contains=mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{4}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
80 syn region mailQuoted4 keepend contains=mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{3}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
81 syn region mailQuoted3 keepend contains=mailQuoted4,mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{2}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
82 syn region mailQuoted2 keepend contains=mailQuoted3,mailQuoted4,mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z(\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{1}\([a-z]\+>\|[]|}>]\)\)" end="^\z1\@!" fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
83 syn region mailQuoted1 keepend contains=mailQuoted2,mailQuoted3,mailQuoted4,mailQuoted5,mailQuoted6,mailVerbatim,mailHeader,@mailLinks,mailSignature,@NoSpell start="^\z([a-z]\+>\|[]|}>]\)" end="^\z1\@!" fold
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " Need to sync on the header. Assume we can do that within 100 lines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 if exists("mail_minlines")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 exec "syn sync minlines=" . mail_minlines
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn sync minlines=100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 " Define the default highlighting.
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1622
diff changeset
93 hi def link mailVerbatim Special
34182
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
94 hi def link mailHeader PreProc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 hi def link mailHeaderKey Type
34182
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
96 hi def link mailSignature Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 hi def link mailHeaderEmail mailEmail
34182
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
98 hi def link mailEmail String
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
99 hi def link mailURL Constant
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
100 hi def link mailSubject Statement
c57f1ae55bfb runtime(mail): updated syntax file
Christian Brabandt <cb@256bit.org>
parents: 5340
diff changeset
101 hi def link mailQuoted1 Function
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 hi def link mailQuoted3 mailQuoted1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 hi def link mailQuoted5 mailQuoted1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 hi def link mailQuoted2 Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 hi def link mailQuoted4 mailQuoted2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 hi def link mailQuoted6 mailQuoted2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 hi def link mailQuoteExp1 mailQuoted1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 hi def link mailQuoteExp2 mailQuoted2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 hi def link mailQuoteExp3 mailQuoted3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 hi def link mailQuoteExp4 mailQuoted4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 hi def link mailQuoteExp5 mailQuoted5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 hi def link mailQuoteExp6 mailQuoted6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 let b:current_syntax = "mail"
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
115
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
116 let &cpo = s:cpo_save
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
117 unlet s:cpo_save