aboutsummaryrefslogtreecommitdiffhomepage
path: root/coq
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <courtieu@lri.fr>2004-04-01 11:14:26 +0000
committerGravatar Pierre Courtieu <courtieu@lri.fr>2004-04-01 11:14:26 +0000
commit8bbe9a95b3daefcb87dc1a4fc0a0ee81ab50202a (patch)
tree2d7448e8507d7a6e3b63ab08aa23c1ab43470809 /coq
parent21bdeaae941e22806b963c417073049201b16c73 (diff)
changed ths syntax for sub/superscript:
- __ makes the following word (if immediately after __) subscript - ^^ makes the following word (if immediately after ^^) superscript - __{...} makes ... subscript - ^^{...} makes ... superscript
Diffstat (limited to 'coq')
-rw-r--r--coq/x-symbol-coq.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/coq/x-symbol-coq.el b/coq/x-symbol-coq.el
index 8a3e138d..13ebe052 100644
--- a/coq/x-symbol-coq.el
+++ b/coq/x-symbol-coq.el
@@ -52,10 +52,10 @@ See `x-symbol-header-groups-alist'."
;; '(x-symbol-make-grammar ...)
(if (fboundp 'x-symbol-make-grammar) ;; x-symbol >=4.3 versions
(x-symbol-make-grammar
- :encode-spec '(((id . "[_'a-zA-Z0-9]") (op . "[]><=\\/~&+-+-*%!{}:|]")) .
- ((id . "[_'a-zA-Z0-9]") (op . "[]><=\\/~&+-+-*%!{}:|]")))
+ :encode-spec '(((id . "['a-zA-Z0-9]") (op . "[]><=\\/~&+-+-*%!{}:|]")) .
+ ((id . "['a-zA-Z0-9]") (op . "[]><=\\/~&+-+-*%!{}:|]")))
:decode-spec nil
- :decode-regexp "\\([_'a-zA-Z0-9]+\\)\\|\\([]><=\\/~&+-*%!{}:|-]+\\)"
+ :decode-regexp "\\(['a-zA-Z0-9]+\\)\\|\\([]><=\\/~&+-*%!{}:|-]+\\)"
:token-list #'x-symbol-coq-default-token-list
:input-spec nil)))
@@ -117,25 +117,25 @@ See language access `x-symbol-LANG-subscript-matcher'."
:group 'x-symbol-coq
:type 'function)
-(defcustom x-symbol-coq-font-lock-regexp "___?\\|^^^?"
+(defcustom x-symbol-coq-font-lock-regexp "_{\\|__\\|\\^{\\|\\^\\^"
"Regexp matching the start tag of Coq super- and subscripts."
:group 'x-symbol-coq
:type 'regexp)
-(defcustom x-symbol-coq-font-lock-limit-regexp "\n\\|__"
+(defcustom x-symbol-coq-font-lock-limit-regexp "}\\|\n"
"Regexp matching the end of line and the end tag of Coq
spanning super- and subscripts."
:group 'x-symbol-coq
:type 'regexp)
-(defcustom x-symbol-coq-font-lock-contents-regexp "\\S-*"
+(defcustom x-symbol-coq-font-lock-contents-regexp ".*"
"*Regexp matching the spanning super- and subscript contents.
This regexp should match the text between the opening and closing super-
or subscript tag."
:group 'x-symbol-coq
:type 'regexp)
-(defcustom x-symbol-coq-single-char-regexp "\\S-"
+(defcustom x-symbol-coq-single-char-regexp "\\>"
"Return regexp matching \<ident> or c for some char c."
:group 'x-symbol-coq
:type 'regexp)
@@ -146,11 +146,10 @@ or subscript tag."
(while (re-search-forward x-symbol-coq-font-lock-regexp limit t)
(setq open-beg (match-beginning 0)
open-end (match-end 0)
- script-type (if (eq (char-after (- open-end 1)) ?_)
+ script-type (if (eq (char-after (- open-end 2)) ?_)
'x-symbol-sub-face
'x-symbol-sup-face))
- (if (or (eq (char-after (- open-end 3)) ?_)
- (eq (char-after (- open-end 3)) ?^)) ; if is spanning sup-/subscript
+ (if (or (eq (char-after (- open-end 1)) ?{)) ; if is spanning sup-/subscript
(when (re-search-forward x-symbol-coq-font-lock-limit-regexp
limit 'limit)
(setq close-beg (match-beginning 0)