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

wait for proof-goto-point to finish #731

Closed
aa755 opened this issue Jan 23, 2024 · 1 comment
Closed

wait for proof-goto-point to finish #731

aa755 opened this issue Jan 23, 2024 · 1 comment

Comments

@aa755
Copy link

aa755 commented Jan 23, 2024

I am writing some IDE automation over proof general and want to implement a blocking version of proof-goto-point, so that the automation can then execute query commands on an uptodate state. I tried the following but it sometimes returns early. What is the right way to do it?

(defun proof-goto-point-and-wait () 
    (proof-goto-point)   
    (sleep-for 1) ;; even with this, on commands that sometimes take long time to process like `Require Import ...`, this function sometimes returns earlier, in a state where the side effects of processing until current point is not yet visible
    (proof-shell-wait))
@hendriktews
Copy link
Collaborator

proof-goto-point being non-blocking is a key feature of Proof General: Emacs stays responsive, while Coq is working in the background, which can easily take minutes.
In the automated tests we have a similar problem, there we use wait-for-coq or variants of it, see for instance ci/simple-tests/coq-test-prelude-correct.el.
Note that there is also a Proof General internal way to solve this problem. You can add specific flags or callbacks to action list items, see proof-shell-action-list-item in generic/proof-shell.el. Automatic background compilation and proof tree visualization use this to get notifications when certain commands have been completely processed.

@aa755 aa755 closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants