From: Chris Hanson Date: Mon, 30 Oct 2000 19:53:23 +0000 (+0000) Subject: Fix bug: previously, selecting one of the buffers of a visible layout X-Git-Tag: 20090517-FFI~3199 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b3646d9d496bac7fc2e9f56ffe00124d14ac2f01;p=mit-scheme.git Fix bug: previously, selecting one of the buffers of a visible layout into a window that held a different buffer of that layout would leave the layout marked as visible. This fix notices this case and unmarks the layout. However, the selection of the buffer causes the layout to be reselected, which means the operation has no net effect. --- diff --git a/v7/src/edwin/curren.scm b/v7/src/edwin/curren.scm index f294114e9..6a4240e11 100644 --- a/v7/src/edwin/curren.scm +++ b/v7/src/edwin/curren.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: curren.scm,v 1.140 2000/10/30 15:41:04 cph Exp $ +;;; $Id: curren.scm,v 1.141 2000/10/30 19:53:23 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -554,7 +554,8 @@ The buffer is guaranteed to be selected at that time." (let ((screen (window-screen window))) (let ((l1 (hash-table/get screen-buffer-layouts screen #f)) (l2 (buffer-get buffer buffer-layout-key #f))) - (and (not (eq? l1 l2)) + (and (or (not (eq? l1 l2)) + (and l1 (buffer-layout-visible? l1 screen))) (begin (if l1 (begin @@ -600,6 +601,16 @@ The buffer is guaranteed to be selected at that time." (if buffer (buffer-remove! buffer buffer-layout-key))))) +(define (buffer-layout-visible? layout screen) + (let loop ((buffers (cdr layout))) + (and (weak-pair? buffers) + (or (not (let ((buffer (weak-car buffers))) + (and buffer + (there-exists? (buffer-windows buffer) + (lambda (window) + (eq? (window-screen window) screen)))))) + (weak-cdr buffers))))) + (define setting-up-buffer-layout? #f) (define buffer-layout-key (list 'BUFFER-LAYOUT)) (define screen-buffer-layouts)