From df960ec29cff2a4bcf95d5b528da20a8c72bc2a7 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 5 Aug 2016 15:07:50 -0700 Subject: [PATCH] edwin/xterm.scm (preview-event-stream): Use dynamic-wind. --- src/edwin/xterm.scm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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!)))) -- 2.25.1