From: Chris Hanson Date: Wed, 24 Apr 1996 01:49:19 +0000 (+0000) Subject: Change OTHER-SCREEN to take a "count" argument. Change uses of X-Git-Tag: 20090517-FFI~5584 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ffed3bf70579746d421eef57d1fb8c1e91a08cfd;p=mit-scheme.git Change OTHER-SCREEN to take a "count" argument. Change uses of OTHER-SCREEN to account for this, and to allow selection of "invisible" windows, which will now be auto-mapped. --- diff --git a/v7/src/edwin/curren.scm b/v7/src/edwin/curren.scm index 0d78b3c0b..e0401cf81 100644 --- a/v7/src/edwin/curren.scm +++ b/v7/src/edwin/curren.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: curren.scm,v 1.120 1996/04/24 01:11:37 cph Exp $ +;;; $Id: curren.scm,v 1.121 1996/04/24 01:49:03 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology ;;; @@ -86,20 +86,23 @@ The frame is guaranteed to be deselected at that time." (make-event-distributor)) (define edwin-variable$screen-creation-hook edwin-variable$frame-creation-hook) -(define (delete-screen! screen) +(define (delete-screen! screen #!optional allow-kill-scheme?) (without-interrupts (lambda () (if (not (screen-deleted? screen)) - (let ((other (other-screen screen true))) + (let ((other (other-screen screen 1 #t))) (if other (begin (if (selected-screen? screen) - (select-screen (or (other-screen screen false) other))) + (select-screen (or (other-screen screen 1 #f) other))) (screen-discard! screen) (set-editor-screens! current-editor (delq! screen - (editor-screens current-editor)))) - ((ref-command save-buffers-kill-scheme) #t))))))) + (editor-screens current-editor))) + #t) + (if (or (default-object? allow-kill-scheme?) allow-kill-scheme?) + ((ref-command save-buffers-kill-scheme) #t) + #f))))))) (define (select-screen screen) (without-interrupts @@ -173,15 +176,20 @@ The frame is guaranteed to be deselected at that time." (else screen))) -(define (other-screen screen invisible-ok?) - (let loop ((screen* screen)) - (let ((screen* (screen1+ screen*))) - (cond ((eq? screen* screen) - false) - ((or invisible-ok? (screen-visible? screen*)) - screen*) - (else - (loop screen*)))))) +(define (other-screen screen n invisible-ok?) + (let ((next-screen (if (> n 0) screen1+ screen-1+))) + (let loop ((screen* screen) (n (abs n))) + (if (= n 0) + screen* + (let ((screen* (next-screen screen*))) + (and (not (eq? screen* screen)) + (loop screen* + (if (or invisible-ok? (screen-visible? screen*)) + (- n 1) + n)))))))) + +(define (other-screen? screen) + (other-screen screen 1 #t)) ;;;; Windows diff --git a/v7/src/edwin/debug.scm b/v7/src/edwin/debug.scm index 489d05fef..166adc33f 100644 --- a/v7/src/edwin/debug.scm +++ b/v7/src/edwin/debug.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: debug.scm,v 1.35 1996/04/23 23:08:30 cph Exp $ +;;; $Id: debug.scm,v 1.36 1996/04/24 01:49:19 cph Exp $ ;;; ;;; Copyright (c) 1992-96 Massachusetts Institute of Technology ;;; @@ -397,7 +397,7 @@ ;; screen is the current screen, delete it too. (let ((new-screen (browser/new-screen browser))) (if (and (eq? new-screen screen) - (other-screen screen #t)) + (other-screen? screen)) (delete-screen! screen)))) ;; Kill the buffer, then maybe select another browser. (let ((browser (get-buffer-browser buffer 'ASSOCIATED-WITH-BROWSER))) diff --git a/v7/src/edwin/wincom.scm b/v7/src/edwin/wincom.scm index fce6c72ba..b6ab830b4 100644 --- a/v7/src/edwin/wincom.scm +++ b/v7/src/edwin/wincom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: wincom.scm,v 1.118 1996/04/23 23:07:26 cph Exp $ +;;; $Id: wincom.scm,v 1.119 1996/04/24 01:48:50 cph Exp $ ;;; ;;; Copyright (c) 1987, 1989-96 Massachusetts Institute of Technology ;;; @@ -345,7 +345,7 @@ or if the window is the only window of its frame." (let ((window (current-window))) (if (and (window-has-no-neighbors? window) (use-multiple-screens?) - (other-screen (selected-screen) false)) + (other-screen? (selected-screen))) (delete-screen! (selected-screen)) (window-delete! window))))) @@ -364,7 +364,7 @@ or if the window is the only window of its frame." (let ((window (other-window n))) (if (current-window? window) (and (use-multiple-screens?) - (let ((screen (other-screen (selected-screen) false))) + (let ((screen (other-screen (selected-screen) 1 #f))) (and screen (screen-selected-window screen)))) window)))) @@ -404,7 +404,7 @@ or if the window is the only window of its frame." (define (select-buffer-other-screen buffer) (if (multiple-screens?) (select-screen - (let ((screen (other-screen (selected-screen) false))) + (let ((screen (other-screen (selected-screen) 1 #t))) (if screen (begin (select-buffer-in-window buffer @@ -520,7 +520,7 @@ Also kills any pop up window it may have created." (if (< (ref-variable split-height-threshold) limit) (set-variable! split-height-threshold limit)) (cond ((and (use-multiple-screens?) - (other-screen (selected-screen) false)) + (other-screen (selected-screen) 1 #t)) => (lambda (screen) (pop-into-window (screen-selected-window screen)))) diff --git a/v7/src/edwin/xterm.scm b/v7/src/edwin/xterm.scm index 31a3e2b23..4a1f9268f 100644 --- a/v7/src/edwin/xterm.scm +++ b/v7/src/edwin/xterm.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: xterm.scm,v 1.52 1996/04/04 18:39:30 cph Exp $ +;;; $Id: xterm.scm,v 1.53 1996/04/24 01:48:40 cph Exp $ ;;; ;;; Copyright (c) 1989-96 Massachusetts Institute of Technology ;;; @@ -729,7 +729,7 @@ (begin (%set-screen-visibility! screen 'UNMAPPED) (and (selected-screen? screen) - (let ((screen (other-screen screen false))) + (let ((screen (other-screen screen 1 #f))) (and screen (make-input-event 'SELECT-SCREEN select-screen