From: Matt Birkholz Date: Fri, 5 Aug 2016 22:07:50 +0000 (-0700) Subject: edwin/xterm.scm (preview-event-stream): Use dynamic-wind. X-Git-Tag: mit-scheme-pucked-9.2.12~261^2~8 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=df960ec29cff2a4bcf95d5b528da20a8c72bc2a7;p=mit-scheme.git edwin/xterm.scm (preview-event-stream): Use dynamic-wind. --- diff --git a/src/edwin/xterm.scm b/src/edwin/xterm.scm index 18cab574c..182fbf183 100644 --- a/src/edwin/xterm.scm +++ b/src/edwin/xterm.scm @@ -592,13 +592,17 @@ USA. (define (preview-events mode) mode - (if previewer-registration - (register!)) - (let loop () - (let ((event (x-display-process-events x-display-data 2))) - (if event - (begin (preview-event event x-display-events) - (loop)))))) + (dynamic-wind + (lambda () unspecific) + (lambda () + (let loop () + (let ((event (x-display-process-events x-display-data 2))) + (if event + (begin (preview-event event x-display-events) + (loop)))))) + (lambda () + (if previewer-registration + (register!))))) (register!))))