fixed x-error handling / warnings because it did return unspecific

This commit is contained in:
frese 2003-05-04 17:35:02 +00:00
parent ed62570d2e
commit aae4511c7b
1 changed files with 11 additions and 13 deletions

View File

@ -29,24 +29,22 @@
(if (not (eq? queue (display:error-queue display))) (if (not (eq? queue (display:error-queue display)))
(let* ((next (next-x-error-queue queue)) (let* ((next (next-x-error-queue queue))
(error (x-error-queue:this next))) (error (x-error-queue:this next)))
(signal-x-warning error)) (signal-x-warning error)))
result)))) result)))
(thunk)) (thunk))
(error "first argument of an xlib-function must be a display object" (error "first argument of an xlib-function must be a display object"
name display))) name display)))
(define (call-critical thunk) (define (call-critical thunk)
(let ((old-enabled (set-enabled-interrupts! no-interrupts)) (let ((old-enabled (set-enabled-interrupts! no-interrupts)))
(result (call-with-current-continuation (with-handler
(lambda (return) (lambda (condition punt)
(cons #t (set-enabled-interrupts! old-enabled)
(with-handler (lambda (condition punt) (punt))
(return (cons #f condition))) (lambda ()
thunk)))))) (let ((result (thunk)))
(set-enabled-interrupts! old-enabled) (set-enabled-interrupts! old-enabled)
(if (car result) result)))))
(cdr result)
(signal-condition (cdr result)))))
;; TODO: pixmap-formats (XListPixmapFormats) ;; TODO: pixmap-formats (XListPixmapFormats)
(define-record-type display :display (define-record-type display :display