diff options
author | 2002-06-18 21:26:11 +0000 | |
---|---|---|
committer | 2002-06-18 21:26:11 +0000 | |
commit | 7d5787375635260df072f2fd441dd5a0eac3c17e (patch) | |
tree | f3330db92b7e0871940c49a73146bec78702eb2e /coq | |
parent | 941fe3bd8f0e18f25bef0b32967794d0ee5049e4 (diff) |
Added a function to inspect the prompt of Coq, in order to know if we
are in proof-mode. Redundant with proof-nesting-depth.
Diffstat (limited to 'coq')
-rw-r--r-- | coq/coq-syntax.el | 3 | ||||
-rw-r--r-- | coq/coq.el | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el index b5993547..6615e584 100644 --- a/coq/coq-syntax.el +++ b/coq/coq-syntax.el @@ -106,6 +106,8 @@ Print and Check commands, put the following line in your .emacs: "Cd" "Check" "DelPath" +"Define" +"Qed" "End" "End\\s-+Silent" "Eval" @@ -135,6 +137,7 @@ Print and Check commands, put the following line in your .emacs: "Show\\s-+Proof" "Show\\s-+Script" "Show" +"Save" "Unfocus" ; ??? ) coq-user-non-backable-commands @@ -230,6 +230,22 @@ (not (proof-string-match "Lemma.*:=" str)))) ;; )) + +; Pierre: This is a try, for use in find-and-forget. It seems to work but +; is it correct with respect to the asynchronous communication between Coq +; and emacs? +; FIXME: Pierre The prompt should be (is?) available by something cleaner +; than this ugly buffer switching. David? :-) +(defun coq-proof-mode-p () + "Look at the last line of the *coq* buffer to see if the prompt +is the toplevel \"Coq <\". Returns nil if yes. Allows to know if we +are currentlly in proof mode. This assumes that no \"Resume\" Command +have been used." + (save-window-excursion + (switch-to-buffer "*coq*") + (not (string-match "^Coq < " (buffer-substring (- (point-max) 8) (point-max)))))) + + ;; TODO : add the stuff to handle the "Correctness" command ;; Pierre: May 29 2002 added a "Back n. " command in order to |