From d6460395d8004d1774241bca5e52bb168f62a144 Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Mon, 16 Apr 2007 12:45:15 +0000 Subject: Patch from Stefan Monnier. --- coq/coq.el | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/coq/coq.el b/coq/coq.el index 4a18eccb..04be03a1 100644 --- a/coq/coq.el +++ b/coq/coq.el @@ -299,18 +299,14 @@ toplevel \"Coq <\". Returns nil if yes. This assumes that no ;; This function returns (defun coq-last-prompt-info (s) "Extract informations from the coq prompt S. See `coq-last-prompt-info-safe'." - (let* ((lastprompt (or s (error "no prompt !!?"))) - (regex - (concat "\\(" coq-id-shy "\\) < \\([0-9]+\\) |\\(\\(?:" coq-id-shy - "|?\\)*\\)| \\([0-9]+\\) < ")) - (s (string-match regex lastprompt)) - (lprf (match-string 3 lastprompt)) - ) - (cons (string-to-int (match-string 2 lastprompt)) - (cons (string-to-int (match-string 4 lastprompt)) - (cons (build-list-id-from-string lprf) nil))) - ) - ) + (let ((lastprompt (or s (error "no prompt !!?"))) + (regex + (concat "\\(" coq-id-shy "\\) < \\([0-9]+\\) |\\(\\(?:" coq-id-shy + "|?\\)*\\)| \\([0-9]+\\) < "))) + (when (string-match regex lastprompt) + (list (string-to-number (match-string 2 lastprompt)) + (string-to-number (match-string 4 lastprompt)) + (build-list-id-from-string (match-string 3 lastprompt)))))) (defun coq-last-prompt-info-safe () -- cgit v1.2.3