aboutsummaryrefslogtreecommitdiff
path: root/stm/stm.mli
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-10-18 23:19:50 +0200
committerEmilio Jesus Gallego Arias2019-04-29 23:35:47 +0200
commit7eefc0b1db614158ed1b322f8c6e5601e3995113 (patch)
tree44e1d73a5ce6337b2aceaa20d42781b57bc23219 /stm/stm.mli
parent69daead8ae18d55ee445a918865ea2adf59439eb (diff)
[stm] Add hooks for document actions.
This arose after a question by Talia Ringer on how to log user-interaction with a Coq document. The hooks would allow a plugin to receive events about user data. This is experimental and will need some tweaks to be useful for sure, in particular w.r.t. errors. [Note: this is safe enough as to be included in 8.9]
Diffstat (limited to 'stm/stm.mli')
-rw-r--r--stm/stm.mli14
1 files changed, 14 insertions, 0 deletions
diff --git a/stm/stm.mli b/stm/stm.mli
index 91651e3534..01bedb4fd8 100644
--- a/stm/stm.mli
+++ b/stm/stm.mli
@@ -297,3 +297,17 @@ val stm_debug : bool ref
type document
val backup : unit -> document
val restore : document -> unit
+
+(** Experimental Hooks for UI experiment plugins, not for general use! *)
+
+type document_edit_notifiers =
+ { add_hook : Vernacexpr.vernac_control CAst.t -> Stateid.t -> unit
+ (** User adds a sentence to the document (after parsing) *)
+ ; edit_hook : Stateid.t -> unit
+ (** User edits a sentence in the document *)
+ ; exec_hook : Stateid.t -> unit
+ (** User requests checking of a sentence in the document. *)
+ }
+
+(** Set the document edit notifiers. *)
+val document_edit_hook : document_edit_notifiers Hook.t