From: Chris Hanson Date: Fri, 21 Aug 1992 22:47:00 +0000 (+0000) Subject: Don't permit inferior REPL evaluation unless the buffer is in X-Git-Tag: 20090517-FFI~9087 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=76db30a50f0c9625f39b9ba4c2f7f0150b67d1a8;p=mit-scheme.git Don't permit inferior REPL evaluation unless the buffer is in inferior-repl mode. --- diff --git a/v7/src/edwin/intmod.scm b/v7/src/edwin/intmod.scm index cce8bebe7..0a7191f49 100644 --- a/v7/src/edwin/intmod.scm +++ b/v7/src/edwin/intmod.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/intmod.scm,v 1.49 1992/08/18 23:32:10 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/intmod.scm,v 1.50 1992/08/21 22:47:00 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology ;;; @@ -443,6 +443,7 @@ If this is an error, the debugger examines the error condition." (end-input-wait port)))) (define (inferior-repl-eval-region buffer region) + (inferior-repl-eval-ok? buffer) (call-with-transcript-output-mark buffer (lambda (mark) (if mark @@ -468,6 +469,7 @@ If this is an error, the debugger examines the error condition." (end-input-wait port))))) (define (inferior-repl-eval-expression buffer expression) + (inferior-repl-eval-ok? buffer) (call-with-transcript-output-mark buffer (lambda (mark) (if mark @@ -481,6 +483,14 @@ If this is an error, the debugger examines the error condition." (move-mark-to! (port/mark port) end)) (enqueue! (port/expression-queue port) expression) (end-input-wait port))) + +(define (inferior-repl-eval-ok? buffer) + (let ((mode (buffer-major-mode buffer))) + (if (not (eq? mode (ref-mode-object inferior-repl))) + (editor-error + (if (eq? mode (ref-mode-object inferior-cmdl)) + "REPL needs response before evaluation will be enabled." + "Can't evaluate -- REPL buffer in anomalous mode."))))) ;;;; Queue