From: Chris Hanson Date: Thu, 26 Oct 2000 02:50:03 +0000 (+0000) Subject: Guarantee that all buffers in a buffer layout are alive at the time of X-Git-Tag: 20090517-FFI~3229 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=50da635cd26a5c2baec99168c76b42f2d5e13585;p=mit-scheme.git Guarantee that all buffers in a buffer layout are alive at the time of selection. --- diff --git a/v7/src/edwin/curren.scm b/v7/src/edwin/curren.scm index 295a6333c..b4e19f41b 100644 --- a/v7/src/edwin/curren.scm +++ b/v7/src/edwin/curren.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: curren.scm,v 1.129 2000/10/26 02:42:07 cph Exp $ +;;; $Id: curren.scm,v 1.130 2000/10/26 02:50:03 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -531,10 +531,18 @@ The buffer is guaranteed to be selected at that time." (delete-other-windows window))) (let ((layout (buffer-get buffer buffer-layout-key #f))) (if layout - (begin - (hash-table/put! screen-buffer-layouts screen layout) - (delete-other-windows window) - ((car layout) window (weak-list->list (cdr layout)))) + (let ((buffers (weak-list->list (cdr layout)))) + (if (for-all? buffers + (lambda (buffer) + (and buffer + (buffer-alive? buffer)))) + (begin + (hash-table/put! screen-buffer-layouts screen layout) + (delete-other-windows window) + ((car layout) window buffers)) + (begin + (delete-buffer-layout buffer) + (set-window-buffer! window buffer)))) (set-window-buffer! window buffer))))) (define (delete-buffer-layout buffer)