diff options
-rw-r--r-- | coq/coq.el | 7 | ||||
-rw-r--r-- | generic/proof-config.el | 14 | ||||
-rw-r--r-- | generic/proof-shell.el | 19 |
3 files changed, 36 insertions, 4 deletions
@@ -1166,14 +1166,17 @@ This is specific to `coq-mode'." pg-subterm-end-char ?\374 ; not done pg-topterm-regexp "\375" - proof-shell-eager-annotation-start "\376\\|\\[Reinterning\\|Warning:" + ;; FIXME: ideally, the eager annotation should just be a single "special" char, + ;; this requires changes in Coq. + proof-shell-eager-annotation-start + "\376\\|\\[Reinterning\\|Warning:\\|TcDebug " proof-shell-eager-annotation-start-length 12 ;; ****** is added at the end of warnings in emacs mode, this is temporary I ;; want xml like tags, and I want them removed before warning display. ;; I want the same for errors -> pgip - proof-shell-eager-annotation-end "\377\\|done\\]\\|\\*\\*\\*\\*\\*\\*" ; done + proof-shell-eager-annotation-end "\377\\|done\\]\\|\\*\\*\\*\\*\\*\\*\\|) >" ; done proof-shell-annotated-prompt-regexp coq-shell-prompt-pattern proof-shell-result-start "\372 Pbp result \373" proof-shell-result-end "\372 End Pbp result \373" diff --git a/generic/proof-config.el b/generic/proof-config.el index c5a49340..7f112979 100644 --- a/generic/proof-config.el +++ b/generic/proof-config.el @@ -1440,6 +1440,20 @@ response buffer." :type '(choice nil regexp) :group 'proof-shell) +(defcustom proof-shell-interactive-prompt-regexp nil + "Matches output from the prover which indicates an interactive prompt. +If we match this, we suppose that the prover has switched to an +interactive diagnostic mode which requires direct interaction +with the shell rather than via script management. In this case, +the shell buffer will be displayed and the user left to their own +devices. + +Note: this should match a string which is bounded by matches +on `proof-shell-eager-annotation-start' and +`proof-shell-eager-annotation-end'." + :type '(choice nil regexp) + :group 'proof-shell) + ;; ;; 3c. tokens mode: turning on/off tokens output diff --git a/generic/proof-shell.el b/generic/proof-shell.el index 4015f3a8..e2146249 100644 --- a/generic/proof-shell.el +++ b/generic/proof-shell.el @@ -1086,8 +1086,9 @@ and indentation. Assumes `proof-script-buffer' is active." (defun proof-shell-process-urgent-message (start end) "Analyse urgent message between START and END for various cases. -Cases are: included file, retracted file, cleared response buffer, -variable setting, PGIP response, or theorem dependency list. +Cases are: *trace* output, included/retracted files, cleared +goals/response buffer, variable setting, xml-encoded PGIP response, +theorem dependency message or interactive output indicator. If none of these apply, display the text between START and END. @@ -1124,6 +1125,12 @@ ends with text matching `proof-shell-eager-annotation-end'." ((proof-looking-at-safe proof-shell-theorem-dependency-list-regexp) (proof-shell-process-urgent-message-thmdeps)) + ((proof-looking-at-safe proof-shell-theorem-dependency-list-regexp) + (proof-shell-process-urgent-message-thmdeps)) + + ((proof-looking-at-safe proof-shell-interactive-prompt-regexp) + (proof-shell-process-interactive-prompt-regexp)) + (t (proof-shell-process-urgent-message-default start end)))) @@ -1211,6 +1218,14 @@ inverse to `proof-register-possibly-new-processed-file'." (cons (split-string names sep) (split-string deps sep))))) +(defun proof-shell-process-interactive-prompt-regexp () + "Action taken when `proof-shell-interactive-prompt-regexp' is observed." + (when (and (proof-shell-live-buffer) + ; not already visible + t) + (switch-to-buffer proof-shell-buffer) + (message "Prover expects input in %s buffer" proof-shell-buffer))) + ;; ;; urgent message utilities ;; |