COMINT-LINE-START was matching COMINT-PROMPT-REGEXP against the
authorChris Hanson <org/chris-hanson/cph>
Fri, 13 Mar 1992 10:05:26 +0000 (10:05 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 13 Mar 1992 10:05:26 +0000 (10:05 +0000)
remainder of the buffer when it is only necessary to match against the
remainder of the line.  This occasionally caused the primitive
re-match-buffer to signal an anonymous error.  This patch
will make the anonymous error extremely unlikely.

The anonymous error indicates a stack-overflow condition that is
difficult to fix properly.  However, the primitive can be modified to
use heuristics that will eliminate the error; the cost is that cases
that would have signalled the error will instead return a non-maximal
match or a non-match in cases where it would have returned a maximal
match had the stack been deep enough.

v7/src/edwin/comint.scm

index fae0fc0690a67ff304c4dea942aed0b4eb57e6f0..55723fe8c80d26d1fdc6ea625deb2c06302400a3 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comint.scm,v 1.12 1992/01/23 20:59:31 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comint.scm,v 1.13 1992/03/13 10:05:26 cph Exp $
 
 Copyright (c) 1991-92 Massachusetts Institute of Technology
 
@@ -375,7 +375,7 @@ comint-prompt-regexp."
     (let ((mark
           (re-match-forward (ref-variable comint-prompt-regexp)
                             start
-                            (group-end mark))))
+                            (line-end mark 0))))
       (if (and mark (mark<= mark (line-end start 0)))
          mark
          start))))