Change OTHER-SCREEN to take a "count" argument. Change uses of
authorChris Hanson <org/chris-hanson/cph>
Wed, 24 Apr 1996 01:49:19 +0000 (01:49 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 24 Apr 1996 01:49:19 +0000 (01:49 +0000)
OTHER-SCREEN to account for this, and to allow selection of
"invisible" windows, which will now be auto-mapped.

v7/src/edwin/curren.scm
v7/src/edwin/debug.scm
v7/src/edwin/wincom.scm
v7/src/edwin/xterm.scm

index 0d78b3c0b5a7f27f71a44ac24c92185127024a2b..e0401cf815d856291cedcea97ee03ec62727a6a4 100644 (file)
@@ -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))
 \f
 ;;;; Windows
 
index 489d05fef4a4fcb22748de9f258415e810a8446f..166adc33f7d0b07fbec4535b04ac041df7810240 100644 (file)
@@ -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
 ;;;
        ;; 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)))
index fce6c72ba83d18110f473fd68cde765efdcb3ead..b6ab830b40405a0bc9d0ae60ba6157e81fae6a8b 100644 (file)
@@ -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))))
index 31a3e2b236db45c913f1e446ac82174140073e46..4a1f9268f7f1c3009661056bfa8469238c071602 100644 (file)
@@ -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
 ;;;
         (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