From 50da635cd26a5c2baec99168c76b42f2d5e13585 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 26 Oct 2000 02:50:03 +0000 Subject: [PATCH] Guarantee that all buffers in a buffer layout are alive at the time of selection. --- v7/src/edwin/curren.scm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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) -- 2.25.1