25 (defconst gadict--art-lang-regex (regexp-opt '("en" "ru" "uk" "la"))) |
25 (defconst gadict--art-lang-regex (regexp-opt '("en" "ru" "uk" "la"))) |
26 (defconst gadict--art-rel-regex (regexp-opt '("ant" "syn" "rel" "topic"))) |
26 (defconst gadict--art-rel-regex (regexp-opt '("ant" "syn" "rel" "topic"))) |
27 (defconst gadict--art-var-regex (regexp-opt '("v1" "v2" "v3" "s" "pl" "male" "female" "abbr" "comp" "super" "Am" "Br" "Au"))) |
27 (defconst gadict--art-var-regex (regexp-opt '("v1" "v2" "v3" "s" "pl" "male" "female" "abbr" "comp" "super" "Am" "Br" "Au"))) |
28 (defconst gadict--art-pos-regex (regexp-opt '("n" "v" "adj" "adv" "pron" "prep" "num" "conj" "int" "phr" "phr.v" "contr" "abbr" "prefix"))) |
28 (defconst gadict--art-pos-regex (regexp-opt '("n" "v" "adj" "adv" "pron" "prep" "num" "conj" "int" "phr" "phr.v" "contr" "abbr" "prefix"))) |
29 |
29 |
|
30 (defgroup gadict nil |
|
31 "gadict-mode customization." |
|
32 :group 'wp) |
|
33 |
|
34 (defface gadict-tr-face '((t :foreground "#40a040" :slant italic)) |
|
35 "Face for marker of translation." |
|
36 :group 'gadict) |
|
37 (defface gadict-ex-face '((t :foreground "#20a0c0" :slant italic)) |
|
38 "Face for marker of example." |
|
39 :group 'gadict) |
|
40 (defface gadict-glos-face '((t :foreground "#a04040" :slant italic)) |
|
41 "Face for marker of explanation." |
|
42 :group 'gadict) |
|
43 |
30 (defvar gadict-font-lock-keywords |
44 (defvar gadict-font-lock-keywords |
31 `( ("^\\(__\\)\n\n\\(\\w.*\\)$" (1 font-lock-function-name-face) (2 font-lock-keyword-face)) |
45 `( ("^\\(__\\)\n\n\\(\\w.*\\)$" (1 font-lock-function-name-face) (2 font-lock-keyword-face)) |
32 ("^ .*\n\\(\\w.*\\)" (1 font-lock-keyword-face)) |
46 ("^ .*\n\\(\\w.*\\)" (1 font-lock-keyword-face)) |
33 ("^#.*" . font-lock-comment-face) |
47 ("^#.*" . font-lock-comment-face) |
34 ("^ +\\[[^]\n]+]" . font-lock-type-face) |
48 ("^ +\\[[^]\n]+]" . font-lock-type-face) |
35 (,(format "^%s: " gadict--art-lang-regex) . font-lock-type-face) |
49 (,(format "^%s: " gadict--art-lang-regex) . 'gadict-tr-face) |
36 (,(format "^%s> " gadict--art-lang-regex) . font-lock-doc-face) |
50 (,(format "^%s> " gadict--art-lang-regex) . 'gadict-ex-face) |
37 (,(format "^%s= " gadict--art-lang-regex) . font-lock-constant-face) |
51 (,(format "^%s= " gadict--art-lang-regex) . 'gadict-glos-face) |
38 (,(format "^%s: " gadict--art-rel-regex) . font-lock-doc-face) |
52 (,(format "^%s: " gadict--art-rel-regex) . font-lock-doc-face) |
39 (,(format "^ +%s$" gadict--art-var-regex) . font-lock-doc-face) |
53 (,(format "^ +%s$" gadict--art-var-regex) . font-lock-doc-face) |
40 (,(format "^%s$" gadict--art-pos-regex) . font-lock-warning-face) )) |
54 (,(format "^%s$" gadict--art-pos-regex) . font-lock-warning-face) )) |
41 |
55 |
42 (defun gadict-setup-fontlock () |
56 (defun gadict-setup-fontlock () |