diff -r 93d0bdb815a1 -r ac68f2680ea0 contrib/gadict.el --- a/contrib/gadict.el Sat Sep 17 10:18:12 2016 +0300 +++ b/contrib/gadict.el Wed Sep 21 22:09:37 2016 +0300 @@ -22,16 +22,22 @@ ;;; Code: +(defconst gadict--art-lang-regex (regexp-opt '("en" "ru" "uk" "la"))) +(defconst gadict--art-rel-regex (regexp-opt '("ant" "syn" "rel" "topic"))) +(defconst gadict--art-var-regex (regexp-opt '("v1" "v2" "v3" "s" "pl" "male" "female" "abbr" "comp" "super" "Am" "Br" "Au"))) +(defconst gadict--art-pos-regex (regexp-opt '("n" "v" "adj" "adv" "pron" "prep" "num" "conj" "int" "phr" "phr\\.v" "contr" "abbr" "prefix"))) + (defvar gadict-font-lock-keywords - '( ("^\\(__\\)\n\n\\(\\w.*\\)$" (1 font-lock-function-name-face) (2 font-lock-keyword-face)) + `( ("^\\(__\\)\n\n\\(\\w.*\\)$" (1 font-lock-function-name-face) (2 font-lock-keyword-face)) ("^ .*\n\\(\\w.*\\)" (1 font-lock-keyword-face)) ("^#.*" . font-lock-comment-face) ("^ +\\[[^]\n]+]" . font-lock-type-face) - ("^\\(?:en\\|ru\\|uk\\|la\\): " . font-lock-type-face) - ("^\\(?:en\\|ru\\|uk\\|la\\)> " . font-lock-doc-face) - ("^\\(?:topic\\|ant\\|syn\\): " . font-lock-doc-face) - ("^ +\\(?:v1\\|v2\\|v3\\|s\\|pl\\|male\\|female\\|abbr\\|comp\\|super\\|Am\\|Br\\|Au\\)$" . font-lock-doc-face) - ("^\\(?:n\\|v\\|adj\\|adv\\|pron\\|prep\\|num\\|conj\\|int\\|phr\\|phr\\.v\\|contr\\|abbr\\|prefix\\)$" . font-lock-type-face) )) + (,(format "^%s: " gadict--art-lang-regex) . font-lock-type-face) + (,(format "^%s> " gadict--art-lang-regex) . font-lock-doc-face) + (,(format "^%s= " gadict--art-lang-regex) . font-lock-constant-face) + (,(format "^%s: " gadict--art-rel-regex) . font-lock-doc-face) + (,(format "^ +%s$" gadict--art-var-regex) . font-lock-doc-face) + (,(format "^%s$" gadict--art-pos-regex) . font-lock-warning-face) )) (defun gadict-setup-fontlock () "Setup gadict fontlock."