From: Arthur Gleckler Date: Mon, 15 Jul 1991 23:56:28 +0000 (+0000) Subject: Add a hook in INVOKE-RESTART-INTERACTIVELY between any interactive X-Git-Tag: 20090517-FFI~10453 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b76312de2c01f7134080e9d36f0b2dbaa7723fa1;p=mit-scheme.git Add a hook in INVOKE-RESTART-INTERACTIVELY between any interactive prompting and the invocation of the restart effector. --- diff --git a/v7/src/runtime/error.scm b/v7/src/runtime/error.scm index d0282cf83..54ac30955 100644 --- a/v7/src/runtime/error.scm +++ b/v7/src/runtime/error.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/error.scm,v 14.14 1991/05/10 00:03:27 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/error.scm,v 14.15 1991/07/15 23:56:28 arthur Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -330,14 +330,23 @@ MIT in each case. |# (guarantee-restart restart 'INVOKE-RESTART) (apply (%restart/effector restart) arguments)) +(define hook/before-restart) + +(define (default/before-restart) + '()) + (define (invoke-restart-interactively restart) (guarantee-restart restart 'INVOKE-RESTART-INTERACTIVELY) (let ((effector (%restart/effector restart)) (interactive (1d-table/get (%restart/properties restart) 'INTERACTIVE false))) (if (not interactive) - (effector) - (with-values interactive effector)))) + (begin (hook/before-restart) + (effector)) + (with-values interactive + (lambda vals + (hook/before-restart) + (apply effector vals)))))) (define (bound-restarts) (let loop ((restarts *bound-restarts*)) @@ -583,6 +592,7 @@ MIT in each case. |# (memq condition-type:error (%condition-type/generalizations type))) (define (initialize-package!) + (set! hook/before-restart default/before-restart) (set! condition-type:serious-condition (make-condition-type 'SERIOUS-CONDITION false '() false)) (set! condition-type:warning