From 706e6332c63fef746baea1a246df8be55405dbc7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 1 Feb 1998 05:12:21 +0000 Subject: [PATCH] Implement mechanism to save a screen configuration for a given dynamic extent. --- v7/src/edwin/buffrm.scm | 26 +++++++++++++++++++++++--- v7/src/edwin/edwin.pkg | 6 ++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/v7/src/edwin/buffrm.scm b/v7/src/edwin/buffrm.scm index 3b7c8c8f3..a6f7af6c2 100644 --- a/v7/src/edwin/buffrm.scm +++ b/v7/src/edwin/buffrm.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: buffrm.scm,v 1.51 1996/05/14 01:24:05 cph Exp $ +;;; $Id: buffrm.scm,v 1.52 1998/02/01 05:11:35 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-98 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -516,4 +516,24 @@ Automatically becomes local when set in any fashion." configuration))) (if window (weak-set-car! *minibuffer-scroll-window* - (convert-window window))))))))) \ No newline at end of file + (convert-window window))))))))) + +(define (with-saved-configuration thunk) + (let ((screen (selected-screen))) + (let ((configuration (screen-window-configuration screen))) + (fluid-let ((restore-saved-continuation? #t)) + (dynamic-wind + (lambda () unspecific) + thunk + (lambda () + (if restore-saved-continuation? + (set-screen-window-configuration! screen configuration)))))))) + +(define (dont-restore-saved-configuration) + ;; This conditional will signal an error if this procedure is called + ;; outside the dynamic context of WITH-SAVED-CONFIGURATION. + (if restore-saved-continuation? + (set! restore-saved-continuation? #f)) + unspecific) + +(define restore-saved-continuation?) \ No newline at end of file diff --git a/v7/src/edwin/edwin.pkg b/v7/src/edwin/edwin.pkg index 389a0eb76..24e269ed9 100644 --- a/v7/src/edwin/edwin.pkg +++ b/v7/src/edwin/edwin.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: edwin.pkg,v 1.219 1998/01/29 06:05:35 cph Exp $ +$Id: edwin.pkg,v 1.220 1998/02/01 05:12:21 cph Exp $ Copyright (c) 1989-98 Massachusetts Institute of Technology @@ -297,6 +297,7 @@ MIT in each case. |# display-style/ignore-input? display-style/ignore-redisplay-flags? display-style/no-screen-output? + dont-restore-saved-configuration edwin-variable$cursor-centering-point edwin-variable$mode-line-inverse-video edwin-variable$scroll-step @@ -339,7 +340,8 @@ MIT in each case. |# window-select-time window-set-override-message! window-start-mark - window-y-center) + window-y-center + with-saved-configuration) (export (edwin screen) editor-frame-screen editor-frame-select-cursor! -- 2.25.1