Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiments to fix the goals not showing on errors. #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions generic/proof-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,33 @@ by the filter is to send the next command from the queue."
;; sets proof-shell-last-output-kind
(proof-shell-handle-immediate-output cmd start end flags)

;; EXPERIMENTS:
;; There was an error, and probably no goal printed before (becaus
;; eof set silent. So we insert a new Show command, and process it
;; immediately by waiting a few milisec and calling
;; proof-shell-handle-delayed-output.
;;
(when (eq proof-shell-last-output-kind 'error)
(proof-add-to-queue
(list ;(proof-shell-stop-silent-item)
(proof-shell-action-list-item "Show." 'proof-shell-clear-silent)))
(setq proof-shell-delayed-output-start (point-max))
(setq proof-shell-delayed-output-flags flags)
(when t; (proof-shell-exec-loop)
(sleep-for 0 100)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this it won't work. This suggests it should be put in some callback instead...

(goto-char proof-shell-delayed-output-start)
(when (re-search-forward proof-shell-annotated-prompt-regexp nil t)
(setq proof-shell-delayed-output-end (match-beginning 0))
(setq proof-shell-last-prompt
(buffer-substring-no-properties (match-beginning 0) (match-end 0)))
)
(setq proof-shell-last-output-kind
;; only display result for last output
(proof-shell-handle-delayed-output))
;(pg-goals-display proof-shell-last-goals-output t)
)
)

(unless proof-shell-last-output-kind ; dealt with already
(setq proof-shell-delayed-output-start start)
(setq proof-shell-delayed-output-end end)
Expand Down