aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--coq/coq-db.el15
-rw-r--r--coq/coq-syntax.el9
-rw-r--r--generic/proof-syntax.el4
3 files changed, 14 insertions, 14 deletions
diff --git a/coq/coq-db.el b/coq/coq-db.el
index 020e3291..a91fb3c9 100644
--- a/coq/coq-db.el
+++ b/coq/coq-db.el
@@ -93,17 +93,20 @@ regexp. See `coq-syntax-db' for DB structure."
(let ((l db) res)
(while l
(let* ((hd (car l)) (tl (cdr l)) ; hd is the first infos list
- (color (concat "\\_<" (nth 4 hd) "\\_>"))) ; colorization string
-; (color (nth 4 hd))) ; colorization string
+ (color (nth 4 hd))) ; colorization string
+; da: do this below, otherwise we get empty words in result!!
+; (color (concat "\\_<" (nth 4 hd) "\\_>"))) ; colorization string
;; TODO delete doublons
(when (and color (or (not filter) (funcall filter hd)))
- (setq res (nconc res (list color)))) ; careful: nconc destructive!
+ (setq res
+ (nconc res (list
+ (concat "\\_<" color "\\_>")))))
(setq l tl)))
res))
(defun coq-build-opt-regexp-from-db (db &optional filter)
"Take a keyword database DB and return a regexps for font-lock.
-If non-nil Optional argument FILTER is a function applying to each line of DB.
+If non-nil optional argument FILTER is a function applying to each line of DB.
For each line if FILTER returns nil, then the keyword is not added to the
regexp. See `coq-syntax-db' for DB structure."
(let ((l db) res)
@@ -114,7 +117,9 @@ regexp. See `coq-syntax-db' for DB structure."
(when (and color (or (not filter) (funcall filter hd)))
(setq res (nconc res (list color)))) ; careful: nconc destructive!
(setq l tl)))
- (proof-ids-to-regexp res)))
+; da: next call is wrong?
+; (proof-ids-to-regexp res)))
+ (proof-regexp-alt-list res)))
;; Computes the max length of strings in a list
diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el
index 802bad68..8b095468 100644
--- a/coq/coq-syntax.el
+++ b/coq/coq-syntax.el
@@ -10,15 +10,6 @@
(require 'proof-utils) ; proof-locate-executable
(require 'coq-db)
-(defsubst proof-regexp-alt-list (args)
- "Return the regexp which matches any of the regexps ARGS."
- ;; see regexp-opt (NB: but that is for strings, not regexps)
- (let ((res ""))
- (dolist (regexp args)
- (setq res (concat res (if (string-equal res "") "\\(?:" "\\|\\(?:")
- regexp "\\)")))
- res))
-
(eval-when-compile
(require 'span)
(defvar coq-goal-command-regexp nil)
diff --git a/generic/proof-syntax.el b/generic/proof-syntax.el
index accd41de..84b5940d 100644
--- a/generic/proof-syntax.el
+++ b/generic/proof-syntax.el
@@ -42,6 +42,10 @@ Uses a regexp of the form \\_<...\\_>."
regexp "\\)")))
res))
+(defsubst proof-regexp-alt-list (args)
+ "Return the regexp which matches any of the regexps ARGS."
+ (apply 'proof-regexp-alt args))
+
(defsubst proof-re-search-forward-region (startre endre)
"Search for a region delimited by regexps STARTRE and ENDRE.
Return the start position of the match for STARTRE, or