Change PROMPT-FOR-EXPRESSION so that variable-name completion in the
authorChris Hanson <org/chris-hanson/cph>
Wed, 27 Oct 1993 02:23:21 +0000 (02:23 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 27 Oct 1993 02:23:21 +0000 (02:23 +0000)
typein buffer uses the environment of the buffer that was current when
PROMPT-FOR-EXPRESSION was called.

v7/src/edwin/evlcom.scm

index c712422e5513108b337244445ccce0b80d142e84..dfe87d9204612e5e35492e6dfb0ab276312baef9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: evlcom.scm,v 1.47 1993/10/26 00:37:59 cph Exp $
+;;;    $Id: evlcom.scm,v 1.48 1993/10/27 02:23:21 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
 ;;;
@@ -321,7 +321,15 @@ Has no effect if evaluate-in-inferior-repl is false."
       (if (eq? default-type 'VISIBLE-DEFAULT)
          'INVISIBLE-DEFAULT
          default-type)
-      (ref-mode-object prompt-for-expression)))))
+      (let ((environment (evaluation-environment #f)))
+       (lambda (buffer)
+         (set-buffer-major-mode! buffer
+                                 (ref-mode-object prompt-for-expression))
+         ;; This sets up the correct environment in the typein buffer
+         ;; so that completion of variables works right.
+         (define-variable-local-value! buffer
+             (ref-variable-object scheme-environment)
+           environment)))))))
 
 (define (read-from-string string)
   (bind-condition-handler (list condition-type:error) evaluation-error-handler