aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <courtieu@lri.fr>2006-10-23 07:46:42 +0000
committerGravatar Pierre Courtieu <courtieu@lri.fr>2006-10-23 07:46:42 +0000
commit40a7b597d4ac26214bd50bf1b0dc19391fd7f1ad (patch)
tree4dd3d2033250bf5fd568623e2fbf374e7525974f
parent8225f0e1764068baa36288b30ad3a16c85830c79 (diff)
Error highlighting in coq only when scripting (not when sending
command invisibly).
-rw-r--r--coq/coq.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/coq/coq.el b/coq/coq.el
index f1d1269d..94e770f3 100644
--- a/coq/coq.el
+++ b/coq/coq.el
@@ -1478,11 +1478,22 @@ buffer."
(delete-span sp)
)))))
-(defun coq-highlight-error-hook ()
- (save-excursion (coq-highlight-error t t)))
+(setq coq-allow-highlight-error t)
+
+;; if a command is sent to coq without being in the script, then don't
+;; higilight the error
+(defun coq-decide-highlight-error ()
+ (if (eq action 'proof-done-invisible)
+ (setq coq-allow-highlight-error nil)
+ (setq coq-allow-highlight-error t)))
+
+(defun coq-highlight-error-hook ()
+ (if coq-allow-highlight-error (save-excursion (coq-highlight-error t t))))
+;; We need this two hooks to highlight only when scripting
(add-hook 'proof-shell-handle-error-or-interrupt-hook 'coq-highlight-error-hook t)
+(add-hook 'proof-shell-insert-hook 'coq-decide-highlight-error t)
(provide 'coq)