From aae4511c7b17b109b8e856c0e2e67807df93dc68 Mon Sep 17 00:00:00 2001 From: frese Date: Sun, 4 May 2003 17:35:02 +0000 Subject: [PATCH] fixed x-error handling / warnings because it did return unspecific --- scheme/xlib/display.scm | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/scheme/xlib/display.scm b/scheme/xlib/display.scm index 0d250f3..7713553 100644 --- a/scheme/xlib/display.scm +++ b/scheme/xlib/display.scm @@ -29,24 +29,22 @@ (if (not (eq? queue (display:error-queue display))) (let* ((next (next-x-error-queue queue)) (error (x-error-queue:this next))) - (signal-x-warning error)) - result)))) + (signal-x-warning error))) + result))) (thunk)) (error "first argument of an xlib-function must be a display object" name display))) (define (call-critical thunk) - (let ((old-enabled (set-enabled-interrupts! no-interrupts)) - (result (call-with-current-continuation - (lambda (return) - (cons #t - (with-handler (lambda (condition punt) - (return (cons #f condition))) - thunk)))))) - (set-enabled-interrupts! old-enabled) - (if (car result) - (cdr result) - (signal-condition (cdr result))))) + (let ((old-enabled (set-enabled-interrupts! no-interrupts))) + (with-handler + (lambda (condition punt) + (set-enabled-interrupts! old-enabled) + (punt)) + (lambda () + (let ((result (thunk))) + (set-enabled-interrupts! old-enabled) + result))))) ;; TODO: pixmap-formats (XListPixmapFormats) (define-record-type display :display