;;; -*-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
;;;
(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
(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
;;; -*-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)))
;;; -*-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
;;;
(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)))))
(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))))
(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
(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))))
;;; -*-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