aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Courtieu2007-04-16 12:45:15 +0000
committerPierre Courtieu2007-04-16 12:45:15 +0000
commitd6460395d8004d1774241bca5e52bb168f62a144 (patch)
tree5646a652bc3b81b88b88f212a89402049b4ed0de
parentc703ca2177dc305224125dbc25326453004e7d58 (diff)
Patch from Stefan Monnier.
-rw-r--r--coq/coq.el20
1 files 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 ()