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

experiment for #188 and #429 -- insert show after error in silent mode #467

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
New hook for early prompt/output analyzis.
proof-state-change-pre-hook happens earlier than
proof-state-change-hook, i.e. before proof-done-advancing. This should
be used to register information in the currently processed span before
proof-done-advancing classifies it.

Historically PG design was to gather these information during
proof-done-advancing (or in its hook called at the end) by just
looking at the command statement. But it is often useful to look at
the output (messages and/or prompt) to gather more accurate
information. Some of this information may be needed DURING
proof-done-advancing. Hence this early hook.
  • Loading branch information
Matafou committed May 27, 2020
commit be78d3cb0c0a1c09ff1a279bf84c59b9da059cbc
2 changes: 1 addition & 1 deletion coq/coq.el
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ If locked span already has a state number, then do nothing. Also updates
;; This hook seems the one we want.
;; WARNING! It is applied once after each command PLUS once before a group of
;; commands is started
(add-hook 'proof-state-change-hook #'coq-set-state-infos)
(add-hook 'proof-state-change-pre-hook #'coq-set-state-infos)


(defun count-not-intersection (l notin)
Expand Down
10 changes: 9 additions & 1 deletion generic/proof-config.el
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,15 @@ This hook is used within Proof General to refresh the toolbar."
:type '(repeat function)
:group 'proof-shell)


(defcustom proof-state-change-pre-hook nil
"Things to do before proof-done-advancing.

E.g. classify spans by looking at the prompt."
:type '(repeat function)
:group 'proof-shell)


;;;;;;
(defcustom proof-dependencies-system-specific nil
"Set this variable to handle system specific dependency output.
Expand All @@ -1787,7 +1796,6 @@ same type as `proof-dependency-in-span-context-menu' returns."
:type '(repeat function)
:group 'proof-shell)
;;;;;

(defcustom proof-shell-syntax-table-entries nil
"List of syntax table entries for proof script mode.
A flat list of the form
Expand Down
3 changes: 3 additions & 0 deletions generic/proof-script.el
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,8 @@ Argument SPAN has just been processed."
(if (span-live-p proof-queue-span)
(proof-set-queue-start end))

(run-hooks 'proof-state-change-pre-hook)

(cond
;; CASE 1: Comments just get highlighted
((eq (span-property span 'type) 'comment)
Expand Down Expand Up @@ -2120,6 +2122,7 @@ which is true for some proof assistants (but probably not others)."
(span-delete span)
(if killfn (funcall killfn start end))))
;; State of scripting may have changed now
(run-hooks 'proof-state-change-pre-hook)
(run-hooks 'proof-state-change-hook))

(defun proof-setup-retract-action (start end proof-commands remove-action &optional
Expand Down
1 change: 1 addition & 0 deletions generic/proof-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,7 @@ If TIMEOUTSECS is a number, time out after that many seconds."
(defun proof-done-invisible (span)
"Callback for ‘proof-shell-invisible-command’.
Call ‘proof-state-change-hook’."
(run-hooks 'proof-state-change-pre-hook)
(run-hooks 'proof-state-change-hook))

;;;###autoload
Expand Down