aboutsummaryrefslogtreecommitdiffhomepage
path: root/coq/coq-syntax.el
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <courtieu@lri.fr>2015-02-23 16:20:57 +0000
committerGravatar Pierre Courtieu <courtieu@lri.fr>2015-02-23 16:20:57 +0000
commit611fbfb2fc93f240c4bb2a8dbbbcfd0921145ef5 (patch)
tree1867b7f052e6411bc73cdb68600138c8faf88153 /coq/coq-syntax.el
parentf735ddcd7472cdb0c9093e803db57a8828f59933 (diff)
Fixed a bug in syntax table making fontlock and indentation fail.
After some command detecting things at point, the indentation was broken.
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)