aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <Pierre.Courtieu@cnam.fr>2015-10-12 20:49:05 +0200
committerGravatar Pierre Courtieu <Pierre.Courtieu@cnam.fr>2015-10-12 20:49:05 +0200
commit14b8d0e24ef48032885018b4020969593477ee26 (patch)
tree9e9b6d76aee7fc03659cf5149e8a5039129818bf /generic
parent6effc3a06b96a791805d69c7dd82ef59349abf26 (diff)
proof-assert-command-hook added + Auto adjust width in coq mode.
This hook was missing, it allows to send complete commands before the (set of) command(s) sent by the user. It shall be used when proof-shell-insert-hook cannot be used (because of multiple prompts appearing).
Diffstat (limited to 'generic')
-rw-r--r--generic/proof-config.el13
-rw-r--r--generic/proof-script.el1
2 files changed, 14 insertions, 0 deletions
diff --git a/generic/proof-config.el b/generic/proof-config.el
index 43ca9a86..fc2dca86 100644
--- a/generic/proof-config.el
+++ b/generic/proof-config.el
@@ -1616,6 +1616,19 @@ it is added to the queue of commands."
:type '(repeat function)
:group 'proof-shell)
+(defcustom proof-assert-command-hook nil
+ "Hooks run before asserting a command (or a set of commands).
+Can be used to insert commands before any (set of) input sent
+by the user. It is run by `proof-assert-until-point'.
+
+WARNING: don't call `proof-assert-until-point' in this hook, you
+would loop forever.
+
+Example of use: Insert a command to adapt printing width. Note
+that `proof-shell-insert-hook' may be use instead (see lego mode)
+if no more prompt will be displayed (see
+`proof-shell-insert-hook' for details).")
+
(defcustom proof-script-preprocess nil
"Function to pre-process (SPAN STRING) taken from proof script."
:type 'function
diff --git a/generic/proof-script.el b/generic/proof-script.el
index fbd8c2b1..338318e7 100644
--- a/generic/proof-script.el
+++ b/generic/proof-script.el
@@ -1912,6 +1912,7 @@ Assumes that point is at the end of a command."
(setq semis (cdr semis)))
(if (null semis) ; maybe inside a string or something.
(error "I can't find any complete commands to process!"))
+ (run-hooks 'proof-assert-command-hook) ;; sneak commands (real ones with a prompt)
(proof-assert-semis semis displayflags)))
(defun proof-assert-electric-terminator ()