;;; -*-Scheme-*-
;;;
-;;; $Id: evlcom.scm,v 1.50 1994/09/16 20:19:23 cph Exp $
+;;; $Id: evlcom.scm,v 1.51 1995/01/06 01:05:56 cph Exp $
;;;
-;;; Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology
;;;
;;; This material was developed by the Scheme project at the
;;; Massachusetts Institute of Technology, Department of
If 'DEFAULT, use the default (REP loop) environment."
'DEFAULT
#f
- (lambda (object) (if (eq? 'DEFAULT object) object (->environment object))))
+ (lambda (object)
+ (if (eq? 'DEFAULT object)
+ object
+ (call-with-current-continuation
+ (lambda (k)
+ (bind-condition-handler (list condition-type:error)
+ (lambda (condition)
+ condition
+ (k 'DEFAULT))
+ (lambda ()
+ (->environment object))))))))
(define-variable scheme-syntax-table
"The syntax table used by the evaluation commands, or #F.
This does not affect editor errors."
#t
boolean?)
-
+\f
(define-variable evaluation-input-recorder
"A procedure that receives each input region before evaluation.
If #F, disables input recording."
Otherwise, expressions are evaluated directly by the commands."
#t
boolean?)
-\f
+
(define-variable transcript-buffer-name
"Name of evaluation transcript buffer.
This can also be a buffer object."
(nearest-repl/syntax-table))
((scheme-syntax-table? syntax-table)
syntax-table)
- ((and (symbol? syntax-table)
- (not (lexical-unreferenceable? environment syntax-table))
- (let ((syntax-table
- (lexical-reference environment syntax-table)))
- (and (scheme-syntax-table? syntax-table)
- syntax-table))))
+ ((symbol? syntax-table)
+ (or (and (not (lexical-unreferenceable? environment syntax-table))
+ (let ((syntax-table
+ (lexical-reference environment syntax-table)))
+ (and (scheme-syntax-table? syntax-table)
+ syntax-table)))
+ (nearest-repl/syntax-table)))
(else
(editor-error "Illegal syntax table: " syntax-table)))))
;;; -*-Scheme-*-
;;;
-;;; $Id: filcom.scm,v 1.180 1994/12/19 19:40:32 cph Exp $
+;;; $Id: filcom.scm,v 1.181 1995/01/06 01:06:09 cph Exp $
;;;
-;;; Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology
;;;
;;; This material was developed by the Scheme project at the
;;; Massachusetts Institute of Technology, Department of
(define-variable-local-value! buffer
(ref-variable-object scheme-environment)
(cadr entry))
- (define-variable-local-value! buffer
- (ref-variable-object scheme-syntax-table)
- (caddr entry)))))))
+ (if (and (eq? 'DEFAULT (ref-variable scheme-environment buffer))
+ (not (eq? 'default (cadr entry))))
+ (begin
+ (message "Ignoring bad evaluation environment: "
+ (cadr entry))
+ (editor-beep)
+ (define-variable-local-value! buffer
+ (ref-variable-object scheme-syntax-table)
+ 'DEFAULT))
+ (define-variable-local-value! buffer
+ (ref-variable-object scheme-syntax-table)
+ (caddr entry))))))))
\f
(define (find-file-revert buffer)
(if (not (verify-visited-file-modification-time? buffer))