Change arguments to OTHER-SCREEN so that only first is required.
authorChris Hanson <org/chris-hanson/cph>
Fri, 1 Dec 2000 06:07:43 +0000 (06:07 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 1 Dec 2000 06:07:43 +0000 (06:07 +0000)
Eliminate OTHER-SCREEN?, replacing occurrences with OTHER-SCREEN.

Change meaning of SCREEN-VISIBLE? to mean "not unmapped"; this is
almost always what was meant.

Fix bug in SELECT-WINDOW: when selecting the selected window of
another frame, must select the frame.

Fix SELECT-BUFFER-OTHER-SCREEN to select the frame as well as the
buffer if reusing an existing frame.

v7/src/edwin/curren.scm
v7/src/edwin/debug.scm
v7/src/edwin/edwin.pkg
v7/src/edwin/os2term.scm
v7/src/edwin/scrcom.scm
v7/src/edwin/screen.scm
v7/src/edwin/win32.scm
v7/src/edwin/wincom.scm

index 6a4240e11c8b1fee42458736de0f49061ae5c227..eef866749835319adb5f6764e2d87a796d46a721 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: curren.scm,v 1.141 2000/10/30 19:53:23 cph Exp $
+;;; $Id: curren.scm,v 1.142 2000/12/01 06:06:54 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
 ;;;
@@ -75,7 +75,7 @@ The frame is guaranteed to be deselected at that time."
           (if other
               (begin
                 (if (selected-screen? screen)
-                    (select-screen (or (other-screen screen 1 #f) other)))
+                    (select-screen (or (other-screen screen) other)))
                 (screen-discard! screen)
                 (set-editor-screens! current-editor
                                      (delq! screen
@@ -156,20 +156,19 @@ The frame is guaranteed to be deselected at that time."
        (else
         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))
+(define (other-screen screen #!optional n invisible-ok?)
+  (let ((n (if (default-object? n) 1 n))
+       (invisible-ok? (if (default-object? invisible-ok?) #f 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)))))))))
 \f
 ;;;; Windows
 
@@ -193,7 +192,9 @@ The frame is guaranteed to be deselected at that time."
    (lambda ()
      (let* ((screen (window-screen window))
            (window* (screen-selected-window screen)))
-       (if (not (eq? window window*))
+       (if (eq? window window*)
+          (if (not (selected-screen? screen))
+              (select-screen screen))
           (begin
             (undo-leave-window! window*)
             (if (selected-screen? screen)
index a96b97f4450acaff8dea335f08c6382467a36726..29ae49798f1fa6034fc189c353b941ac32b4746f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: debug.scm,v 1.53 2000/10/30 15:43:28 cph Exp $
+;;; $Id: debug.scm,v 1.54 2000/12/01 06:07:13 cph Exp $
 ;;;
 ;;; Copyright (c) 1992-2000 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))
+                  (other-screen screen 1 #t))
              (delete-screen! screen))))
       ;; Kill the buffer, then maybe select another browser.
       (let ((browser (get-buffer-browser buffer 'ASSOCIATED-WITH-BROWSER)))
index 7729ba809411988e17299b9766c587740aa40f4c..bf4c4602ad58061bb8cd055207c5fea0eb66a167 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: edwin.pkg,v 1.264 2000/10/26 02:28:10 cph Exp $
+$Id: edwin.pkg,v 1.265 2000/12/01 06:07:21 cph Exp $
 
 Copyright (c) 1989-2000 Massachusetts Institute of Technology
 
@@ -995,7 +995,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
            os/interprogram-cut
            os/interprogram-paste
            x-root-window-size
-           x-screen-auto-raise
            x-screen-ignore-focus-button?
            x-selection-timeout
            xterm-screen/flush!
@@ -1016,7 +1015,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     (files "xcom")
     (parent (edwin))
     (export (edwin)
-           edwin-command$auto-raise-mode
            edwin-command$lower-frame
            edwin-command$raise-frame
            edwin-command$set-background-color
@@ -1034,7 +1032,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
            edwin-command$set-mouse-shape
            edwin-command$show-frame-position
            edwin-command$show-frame-size
-           edwin-command$x-auto-raise-mode
            edwin-command$x-lower-screen
            edwin-command$x-mouse-ignore
            edwin-command$x-mouse-keep-one-window
index eb50da2b34429467bf915a419302bd42ea48d0a7..23cae831c241c67912498f322c2b65a1cb4fb888 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: os2term.scm,v 1.21 1999/01/02 06:11:34 cph Exp $
+;;; $Id: os2term.scm,v 1.22 2000/12/01 06:07:26 cph Exp $
 ;;;
-;;; Copyright (c) 1994-1999 Massachusetts Institute of Technology
+;;; Copyright (c) 1994-2000 Massachusetts Institute of Technology
 ;;;
 ;;; This program is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU General Public License as
             (begin
               (set-screen-visibility! screen 'UNMAPPED)
               (and (selected-screen? screen)
-                   (let ((screen (other-screen screen 1 #f)))
+                   (let ((screen (other-screen screen)))
                      (and screen
                           (make-input-event 'SELECT-SCREEN
                                             select-screen
index 54da998d204451a32a779edd9394b3f02445321e..0377c1550a94fc1c4b614d985a8c39588c6ee715 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: scrcom.scm,v 1.7 2000/12/01 05:24:42 cph Exp $
+;;; $Id: scrcom.scm,v 1.8 2000/12/01 06:07:30 cph Exp $
 ;;;
 ;;; Copyright (c) 1990-2000 Massachusetts Institute of Technology
 ;;;
@@ -42,7 +42,7 @@ This command selects the frame ARG steps away in that order.
 A negative ARG moves in the opposite order."
   "p"
   (lambda (arg)
-    (let ((screen (other-screen (selected-screen) arg #f)))
+    (let ((screen (other-screen (selected-screen) arg)))
       (if (not screen)
          (editor-error "No other visible frame."))
       (select-screen screen))))
index df63837cfb55d17c181135bbc854950d9c961c1c..3831e9ee94b90ebbf17658febcd197d6b62a73ef 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: screen.scm,v 1.117 1999/05/08 19:22:54 cph Exp $
+;;; $Id: screen.scm,v 1.118 2000/12/01 06:07:35 cph Exp $
 ;;;
-;;; Copyright (c) 1989-1999 Massachusetts Institute of Technology
+;;; Copyright (c) 1989-2000 Massachusetts Institute of Technology
 ;;;
 ;;; This program is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU General Public License as
@@ -63,6 +63,8 @@
   (operation/write-substring! false read-only true)
   (preemption-modulus false read-only true)
   (root-window false)
+  ;; Visibility is one of the following:
+  ;; VISIBLE PARTIALLY-OBSCURED OBSCURED UNMAPPED DELETED
   (visibility 'VISIBLE)
   (needs-update? false)
   (in-update? false)
                          'DESELECT-SCREEN))
 
 (define (screen-discard! screen)
-  (if (not (eq? (screen-visibility screen) 'DELETED))
+  (if (not (screen-deleted? screen))
       (begin
        (set-screen-visibility! screen 'DELETED)
        (for-each (lambda (window) (send window ':kill!))
   (editor-frame-screen (window-root-window window)))
 
 (define (screen-visible? screen)
-  (or (eq? 'VISIBLE (screen-visibility screen))
-      (eq? 'PARTIALLY-OBSCURED (screen-visibility screen))))
+  (not (or (screen-deleted? screen)
+          (eq? 'UNMAPPED (screen-visibility screen)))))
 
 (define-integrable (screen-deleted? screen)
   (eq? 'DELETED (screen-visibility screen)))
               screen
               (lambda ()
                 (and (thunk)
-                     (if (screen-visible? screen)
+                     (if (memq (screen-visibility screen)
+                               '(VISIBLE PARTIALLY-OBSCURED))
                          (and (or (not (screen-needs-update? screen))
                                   (and (not (display-style/no-screen-output?
                                              display-style))
index 70aa3b919976e14ec645d23c7b6082532ce9bfa9..06624fec31ff60c16e2f42435dbb1321b3bb987a 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: win32.scm,v 1.13 2000/05/01 03:01:39 cph Exp $
+;;; $Id: win32.scm,v 1.14 2000/12/01 06:07:39 cph Exp $
 ;;;
 ;;; Copyright (c) 1994-2000 Massachusetts Institute of Technology
 ;;;
               (screen-force-update screen)
               (make-input-event 'UPDATE update-screen! screen #f))
             (and (selected-screen? screen)
-                 (let ((screen (other-screen screen 1 #f)))
+                 (let ((screen (other-screen screen)))
                    (and screen
                         (make-input-event 'SELECT-SCREEN
                                           select-screen
index d7ed9c194a467d260d6f16d2d99c0fed9df16baf..41b382ae96b2f35f32ff7f7d48bcd1e945bd035b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: wincom.scm,v 1.130 2000/10/27 04:01:16 cph Exp $
+;;; $Id: wincom.scm,v 1.131 2000/12/01 06:07:43 cph Exp $
 ;;;
 ;;; Copyright (c) 1987, 1989-2000 Massachusetts Institute of Technology
 ;;;
@@ -321,7 +321,7 @@ or if the window is the only window of its frame."
     (let ((window (selected-window)))
       (if (and (window-has-no-neighbors? window)
               (use-multiple-screens?)
-              (other-screen? (selected-screen)))
+              (other-screen (selected-screen) 1 #t))
          (delete-screen! (selected-screen))
          (window-delete! window)))))
 
@@ -340,7 +340,7 @@ or if the window is the only window of its frame."
         (let ((window (other-window n)))
           (if (selected-window? window)
               (and (use-multiple-screens?)
-                   (let ((screen (other-screen (selected-screen) 1 #f)))
+                   (let ((screen (other-screen (selected-screen))))
                      (and screen
                           (screen-selected-window screen))))
               window))))
@@ -382,10 +382,11 @@ or if the window is the only window of its frame."
       (let ((screen
             (other-screen (if (or (default-object? screen) (not screen))
                               (selected-screen)
-                              screen)
-                          1 #t)))
+                              screen))))
        (if screen
-           (select-buffer buffer (screen-selected-window screen))
+           (let ((window (screen-selected-window screen)))
+             (select-window window)
+             (select-buffer buffer window))
            (make-screen buffer)))
       (editor-error "Display doesn't support multiple screens")))
 
@@ -545,7 +546,7 @@ Also kills any pop up window it may have created."
                (set-variable! split-height-threshold limit))
            (maybe-deselect-buffer-layout screen)
            (cond ((and (use-multiple-screens?)
-                       (other-screen screen 1 #t))
+                       (other-screen screen))
                   => (lambda (screen)
                        (pop-into-window (screen-selected-window screen))))
                  ((ref-variable preserve-window-arrangement)