From 3b20a97a9eb3bae14a5d77665479cef03b667cc9 Mon Sep 17 00:00:00 2001
From: Arthur Gleckler <edu/mit/csail/zurich/arthur>
Date: Tue, 6 Aug 1991 22:12:23 +0000
Subject: [PATCH] Use with-history-disabled in with-new-history so that new
 evaluations are guaranteed to have at least one interpreter return frame,
 thus making the continuation parser work better in the presence of compiled
 code.

with-new-history no longer tail-recurses into the thunk.
---
 v7/src/runtime/histry.scm | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/v7/src/runtime/histry.scm b/v7/src/runtime/histry.scm
index ae69efcea..98945e48a 100644
--- a/v7/src/runtime/histry.scm
+++ b/v7/src/runtime/histry.scm
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/histry.scm,v 14.3 1990/08/08 00:58:12 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/histry.scm,v 14.4 1991/08/06 22:12:23 arthur Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -134,23 +134,25 @@ MIT in each case. |#
 ;;; SET-CURRENT-HISTORY! is run.
 
 (define (with-new-history thunk)
-  ((ucode-primitive set-current-history!)
-   (let ((history
-	  (push-history! (create-history max-subproblems
-					 max-reductions))))
-     (if (zero? max-subproblems)
-
-	 ;; In this case, we want the history to appear empty,
-	 ;; so when it pops up, there is nothing in it.
-	 history
-
-	 ;; Otherwise, record a dummy reduction, which will appear
-	 ;; in the history.
-	 (begin (record-evaluation-in-history! history
-					       false
-					       system-global-environment)
-		(push-history! history)))))
-  (thunk))
+  (with-history-disabled
+    (lambda ()
+      ((ucode-primitive set-current-history!)
+       (let ((history
+	      (push-history! (create-history max-subproblems
+					     max-reductions))))
+	 (if (zero? max-subproblems)
+
+	     ;; In this case, we want the history to appear empty,
+	     ;; so when it pops up, there is nothing in it.
+	     history
+
+	     ;; Otherwise, record a dummy reduction, which will appear
+	     ;; in the history.
+	     (begin (record-evaluation-in-history! history
+						   false
+						   system-global-environment)
+		    (push-history! history)))))
+      (thunk))))
 
 (define max-subproblems 10)
 (define max-reductions 5)
-- 
2.25.1