From 06fd76163b857a056ac44e7437efa17656f06e5b Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Wed, 8 Mar 2017 15:49:39 +0100 Subject: Fixing unicode tokens in generic code and in coq. --- lib/unicode-tokens.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/unicode-tokens.el') diff --git a/lib/unicode-tokens.el b/lib/unicode-tokens.el index b52d035a..ba3d036a 100644 --- a/lib/unicode-tokens.el +++ b/lib/unicode-tokens.el @@ -427,16 +427,19 @@ This function also initialises the important tables for the mode." ;; hairy logic based on Coq-style vs Isabelle-style configs (if (string= "" (format unicode-tokens-token-format "")) ;; no special token format, parse separate words/symbols - (let* ((optoks - (remove* "^\\(?:\\sw\\|\\s_\\)+$" - toks :test 'string-match)) - (idtoks - (set-difference toks optoks)) + (let* ((tokextra (remove* "^\\(?:\\sw\\|\\s_\\)+$" toks :test 'string-match)) + (toksymbwrd (set-difference toks tokextra)) + ;; indentifier that are not pure words + (toksymb (remove* "^\\(?:\\sw\\)+$" toksymbwrd :test 'string-match)) + ;; pure words + (tokwrd (set-difference toksymbwrd toksymb)) (idorop (concat "\\(\\_<" - (regexp-opt idtoks) - "\\_>\\|\\(?:\\B" - (regexp-opt optoks) + (regexp-opt toksymb) + "\\_>\\|\\(?:\\<" + (regexp-opt tokwrd) + "\\>\\)\\|\\(?:\\B" + (regexp-opt tokextra) "\\B\\)\\)"))) (if unicode-tokens-token-variant-format-regexp (format unicode-tokens-token-variant-format-regexp -- cgit v1.2.3