aboutsummaryrefslogtreecommitdiff
path: root/coq/coq-syntax.el
diff options
context:
space:
mode:
Diffstat (limited to 'coq/coq-syntax.el')
-rw-r--r--coq/coq-syntax.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el
index 7848bcac..a4e11ba1 100644
--- a/coq/coq-syntax.el
+++ b/coq/coq-syntax.el
@@ -1096,6 +1096,16 @@ It is used:
(modify-syntax-entry ?\( "()1")
(modify-syntax-entry ?\) ")(4"))
+;; use this to evaluate code with "." being consisdered a symbol
+;; constituent (better behavior for thing-at and maybe font-lock too,
+;; for indentation we use ad hoc smie lexers).
+(defmacro coq-with-altered-syntax-table (&rest code)
+ (let ((res (make-symbol "res")))
+ `(unwind-protect
+ (progn (modify-syntax-entry ?\. "_")
+ (let ((,res (progn ,@code)))
+ (modify-syntax-entry ?\. ".")
+ ,res)))))
(defconst coq-generic-expression
(mapcar (lambda (kw)