From 987c4a3f3302a56af59cce103d9846043d49633b Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Tue, 12 Dec 2006 10:48:39 +0000 Subject: Fixed coq 8.0 compatibility and coq version detection. --- coq/coq-syntax.el | 5 ++++- coq/coq.el | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'coq') diff --git a/coq/coq-syntax.el b/coq/coq-syntax.el index 87eac7c0..d9cd479d 100644 --- a/coq/coq-syntax.el +++ b/coq/coq-syntax.el @@ -56,13 +56,16 @@ version of coq by doing 'coqtop -v'." ) (t;; otherwise do coqtop -v and see which version we have (let* ((str (shell-command-to-string (concat coq-prog-name " -v"))) ;; this match sets match-string below - (ver (string-match "version \\([.0-9]*\\)" str))) + (ver (string-match "version v?\\([.0-9]*\\)" str))) (message str) (let ((num (and ver (match-string 1 str)))) (cond ((and num (string-match "\\<8.0" num)) (message v80) (setq coq-version-is-V8-0 t)) + ((and num (string-match "\\<8.1" num)) + (message v81) + (setq coq-version-is-V8-1 t)) (t ; 8.1 by default now (message (concat "Falling back to default: " v81)) (setq coq-version-is-V8-1 t))))))))) diff --git a/coq/coq.el b/coq/coq.el index 94e770f3..cd1f6356 100644 --- a/coq/coq.el +++ b/coq/coq.el @@ -85,8 +85,11 @@ To disable coqc being called (and use only make), set this to nil." ;; quarter of 2005). (defvar coq-shell-prompt-pattern - (concat "\\(?:\n" proof-id " < [^\n]+\371\\|\n[^\n]+\\)") - "*The prompt pattern for the inferior shell running coq.") + (if coq-version-is-V8-0 + (concat "\\(?:\n" proof-id " < \\)") + (concat "\\(?:\n" proof-id " < [^\n]+\371\\|\n[^\n]+\\)") + ) + "*The prompt pattern for the inferior shell running coq.") ; (concat "^\n?" proof-id " < \\(?:[0-9]+ |\\(?:" proof-id "|?\\)*| " "[0-9]+ < \\)?\\(?:\x6\\|\371\\)") ;; FIXME da: this was disabled (set to nil) -- why? -- cgit v1.2.3