aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Paul Steckler <steck@stecksoft.com>2017-03-08 10:49:09 -0500
committerGravatar Paul Steckler <steck@stecksoft.com>2017-03-08 10:49:09 -0500
commit6c703907b192bc903ca9897e17424e58e2003692 (patch)
treeaa42d5b9a292e09a31d36bf44a867dbd48b979fb
parent915ad2578489919e169fdcf4fe76a4f070268073 (diff)
parent06fd76163b857a056ac44e7437efa17656f06e5b (diff)
-rw-r--r--coq/coq-unicode-tokens.el23
-rw-r--r--lib/unicode-tokens.el19
2 files changed, 25 insertions, 17 deletions
diff --git a/coq/coq-unicode-tokens.el b/coq/coq-unicode-tokens.el
index d02ea70b..faa02458 100644
--- a/coq/coq-unicode-tokens.el
+++ b/coq/coq-unicode-tokens.el
@@ -36,7 +36,7 @@
(require 'proof-unicode-tokens)
-(defconst coq-token-format "%s") ; plain tokens
+(defconst coq-token-format "") ; Let generic code do the job
(defconst coq-token-match nil)
(defconst coq-hexcode-match nil)
@@ -253,24 +253,29 @@ meaning to be useful."
(defconst coq-control-char-format-regexp
;; FIXME: fix Coq identifier syntax below
- "\\(\s*%s\s*\\)\\([a-zA-Z0-9']+\\)")
+ ;; "\\(\s_*%s\s_*\\)\\([a-zA-Z0-9']+\\)"
+ "\\(%s\\)\\(\\sw*\\)"
+ )
-(defconst coq-control-char-format " %s ")
+;; (defconst coq-control-char-format " %s ")
(defconst coq-control-characters
'(("Subscript" "__" sub)
("Superscript" "^^" sup)))
-(defconst coq-control-region-format-regexp "\\(\s*%s\{\\)\\([^}]*\\)\\(\}\s*\\)")
+;(defconst coq-control-region-format-regexp "\\(\s*%s\{\\)\\([^}]*\\)\\(\}\s*\\)")
+(defconst coq-control-region-format-regexp "\\(%s\{\\)\\([^}]*\\)\\(\}\\)")
(defconst coq-control-regions
'(("Subscript" "," "" sub)
+ ("Subscript" "_" "" sub)
("Superscript" "^" "" sup)
- ("Bold" "BOLD" "" bold)
- ("Italic" "ITALIC" "" italic)
- ("Script" "SCRIPT" "" script)
- ("Frakt" "FRACT" "" frakt)
- ("Roman" "ROMAN" "" serif)))
+; ("Bold" "BOLD" "" bold)
+; ("Italic" "ITALIC" "" italic)
+; ("Script" "SCRIPT" "" script)
+; ("Frakt" "FRACT" "" frakt)
+; ("Roman" "ROMAN" "" serif)
+))
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