From: Chris Hanson Date: Fri, 10 Jan 2003 20:25:05 +0000 (+0000) Subject: Eliminate last vestiges of UNWIND-PROTECT. X-Git-Tag: 20090517-FFI~2064 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=5007cabb8793330d24e2fd33544bac2a1e2415f6;p=mit-scheme.git Eliminate last vestiges of UNWIND-PROTECT. --- diff --git a/v7/src/edwin/bufcom.scm b/v7/src/edwin/bufcom.scm index 1a185c820..864254606 100644 --- a/v7/src/edwin/bufcom.scm +++ b/v7/src/edwin/bufcom.scm @@ -1,25 +1,27 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: bufcom.scm,v 1.108 2002/11/20 19:45:58 cph Exp $ -;;; -;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: bufcom.scm,v 1.109 2003/01/10 20:24:03 cph Exp $ + +Copyright 1986,1989,1990,1992,1994,1996 Massachusetts Institute of Technology +Copyright 1997,1998,1999,2000,2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; Buffer Commands @@ -275,14 +277,14 @@ When locked, the buffer's major mode may not be changed." (define (call-with-temporary-buffer name procedure) (let ((buffer)) - (unwind-protect (lambda () - (set! buffer (temporary-buffer name))) - (lambda () - (procedure buffer)) - (lambda () - (kill-buffer buffer) - (set! buffer) - unspecific)))) + (dynamic-wind (lambda () + (set! buffer (temporary-buffer name))) + (lambda () + (procedure buffer)) + (lambda () + (kill-buffer buffer) + (set! buffer) + unspecific)))) (define (temporary-buffer name) (let ((buffer (find-or-create-buffer name))) diff --git a/v7/src/edwin/doscom.scm b/v7/src/edwin/doscom.scm index 3510e8e42..738350ec0 100644 --- a/v7/src/edwin/doscom.scm +++ b/v7/src/edwin/doscom.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: doscom.scm,v 1.4 2002/11/20 19:45:59 cph Exp $ +$Id: doscom.scm,v 1.5 2003/01/10 20:24:09 cph Exp $ -Copyright (c) 1992-1999 Massachusetts Institute of Technology +Copyright 1993,2003 Massachusetts Institute of Technology This file is part of MIT Scheme. @@ -59,7 +59,7 @@ Prefix arg means replace the region with it." (mark (current-mark))) (let ((swap? (mark< point mark)) (temp)) - (unwind-protect + (dynamic-wind (lambda () (set! temp (temporary-buffer " *shell-output*")) unspecific) diff --git a/v7/src/edwin/dosshell.scm b/v7/src/edwin/dosshell.scm index 98b6cfaf3..a94b6410a 100644 --- a/v7/src/edwin/dosshell.scm +++ b/v7/src/edwin/dosshell.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: dosshell.scm,v 1.6 2002/11/20 19:45:59 cph Exp $ +$Id: dosshell.scm,v 1.7 2003/01/10 20:24:15 cph Exp $ -Copyright (c) 1992-1999, 2001 Massachusetts Institute of Technology +Copyright 1993,2001,2003 Massachusetts Institute of Technology This file is part of MIT Scheme. @@ -167,8 +167,9 @@ With argument, don't skip the prompt -- go straight to column 0." (insert-region (line-start start 0) end (buffer-end buffer)))) (buffer-freshline buffer) - (unwind-protect - #f + (dynamic-wind + (lambda () + unspecific) (lambda () (pseudo-execute command (buffer-default-directory buffer) diff --git a/v7/src/edwin/editor.scm b/v7/src/edwin/editor.scm index 4b2238855..0ce4c6a89 100644 --- a/v7/src/edwin/editor.scm +++ b/v7/src/edwin/editor.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: editor.scm,v 1.256 2003/01/10 20:09:36 cph Exp $ +$Id: editor.scm,v 1.257 2003/01/10 20:24:21 cph Exp $ Copyright 1986,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -484,9 +484,6 @@ TRANSCRIPT messages appear in transcript buffer, if it is enabled; (define (exit-scheme) (within-continuation editor-abort %exit)) -(define (unwind-protect setup body cleanup) - (dynamic-wind (or setup (lambda () unspecific)) body cleanup)) - (define (editor-grab-display editor receiver) (display-type/with-display-grabbed (editor-display-type editor) (lambda (with-display-ungrabbed operations) diff --git a/v7/src/edwin/edtstr.scm b/v7/src/edwin/edtstr.scm index 23827687d..1b127d151 100644 --- a/v7/src/edwin/edtstr.scm +++ b/v7/src/edwin/edtstr.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: edtstr.scm,v 1.27 2003/01/10 18:51:17 cph Exp $ +$Id: edtstr.scm,v 1.28 2003/01/10 20:24:27 cph Exp $ Copyright 1989,1990,1991,1992,2003 Massachusetts Institute of Technology @@ -102,7 +102,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. (define (with-current-button-event button-event thunk) (let ((old-button-event)) - (unwind-protect + (dynamic-wind (lambda () (set! old-button-event (editor-button-event current-editor)) (set-editor-button-event! current-editor button-event) diff --git a/v7/src/edwin/fileio.scm b/v7/src/edwin/fileio.scm index 8cb190f50..8a821cd38 100644 --- a/v7/src/edwin/fileio.scm +++ b/v7/src/edwin/fileio.scm @@ -1,25 +1,28 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: fileio.scm,v 1.159 2002/11/20 19:46:00 cph Exp $ -;;; -;;; Copyright (c) 1986, 1989-2002 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: fileio.scm,v 1.160 2003/01/10 20:24:33 cph Exp $ + +Copyright 1986,1989,1991,1992,1993,1994 Massachusetts Institute of Technology +Copyright 1995,1997,1999,2000,2001,2002 Massachusetts Institute of Technology +Copyright 2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; File <-> Buffer I/O @@ -539,8 +542,9 @@ Otherwise, a message is written both before and after long file writes." (rename-file pathname old) (set! modes (file-modes old)) #t)))) - (unwind-protect - #f + (dynamic-wind + (lambda () + unspecific) (lambda () (clear-visited-file-modification-time! buffer) (write-buffer buffer) diff --git a/v7/src/edwin/process.scm b/v7/src/edwin/process.scm index fe9dd8f26..7bf116bd0 100644 --- a/v7/src/edwin/process.scm +++ b/v7/src/edwin/process.scm @@ -1,25 +1,27 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: process.scm,v 1.62 2002/11/20 19:46:02 cph Exp $ -;;; -;;; Copyright (c) 1991-2001 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: process.scm,v 1.63 2003/01/10 20:24:40 cph Exp $ + +Copyright 1991,1992,1993,1996,1997,1999 Massachusetts Institute of Technology +Copyright 2000,2001,2002,2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; Subprocess Support ;; package: (edwin process) @@ -678,7 +680,7 @@ Prefix arg means replace the region with it." (mark (current-mark))) (let ((swap? (mark< point mark)) (temp)) - (unwind-protect + (dynamic-wind (lambda () (set! temp (temporary-buffer " *shell-output*")) unspecific) diff --git a/v7/src/edwin/regexp.scm b/v7/src/edwin/regexp.scm index 36789b537..d660289a4 100644 --- a/v7/src/edwin/regexp.scm +++ b/v7/src/edwin/regexp.scm @@ -1,25 +1,27 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: regexp.scm,v 1.79 2002/11/20 19:46:02 cph Exp $ -;;; -;;; Copyright (c) 1986, 1989-2002 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: regexp.scm,v 1.80 2003/01/10 20:24:46 cph Exp $ + +Copyright 1986,1989,1991,1992,1993,1995 Massachusetts Institute of Technology +Copyright 1996,1997,1999,2001,2002,2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; Regular Expressions @@ -89,9 +91,9 @@ (define (preserving-match-data thunk) (let ((data unspecific)) - (unwind-protect (lambda () (set! data (re-match-data)) unspecific) - thunk - (lambda () (set-re-match-data! data))))) + (dynamic-wind (lambda () (set! data (re-match-data)) unspecific) + thunk + (lambda () (set-re-match-data! data))))) (define (replace-match replacement #!optional preserve-case? literal?) (let ((start (re-match-start 0)) diff --git a/v7/src/edwin/regops.scm b/v7/src/edwin/regops.scm index 36e4a1dda..6b2cdfda5 100644 --- a/v7/src/edwin/regops.scm +++ b/v7/src/edwin/regops.scm @@ -1,25 +1,27 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: regops.scm,v 1.89 2002/11/20 19:46:02 cph Exp $ -;;; -;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: regops.scm,v 1.90 2003/01/10 20:24:52 cph Exp $ + +Copyright 1986,1989,1991,1992,1993,2000 Massachusetts Institute of Technology +Copyright 2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; Region/Mark Operations @@ -123,23 +125,23 @@ (define (with-region-clipped! new-region thunk) (let ((group (region-group new-region)) (old-region)) - (unwind-protect (lambda () - (set! old-region (group-region group)) - (region-clip! new-region) - (set! new-region) - unspecific) - thunk - (lambda () - (region-clip! old-region))))) + (dynamic-wind (lambda () + (set! old-region (group-region group)) + (region-clip! new-region) + (set! new-region) + unspecific) + thunk + (lambda () + (region-clip! old-region))))) (define (without-group-clipped! group thunk) (let ((old-region)) - (unwind-protect (lambda () - (set! old-region (group-region group)) - (group-widen! group)) - thunk - (lambda () - (region-clip! old-region))))) + (dynamic-wind (lambda () + (set! old-region (group-region group)) + (group-widen! group)) + thunk + (lambda () + (region-clip! old-region))))) (define (group-clipped? group) (not (and (zero? (group-start-index group)) diff --git a/v7/src/edwin/rmail.scm b/v7/src/edwin/rmail.scm index 0845ec284..25ad9f8c3 100644 --- a/v7/src/edwin/rmail.scm +++ b/v7/src/edwin/rmail.scm @@ -1,25 +1,27 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: rmail.scm,v 1.73 2002/11/20 19:46:02 cph Exp $ -;;; -;;; Copyright (c) 1991-2001 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: rmail.scm,v 1.74 2003/01/10 20:24:58 cph Exp $ + +Copyright 1991,1992,1993,1994,1995,1999 Massachusetts Institute of Technology +Copyright 2000,2001,2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; RMAIL Mail Reader @@ -2131,21 +2133,21 @@ Completion is performed over known labels when reading." (outside-end) (inside-start (mark-permanent! (group-absolute-start group))) (inside-end (mark-permanent! (group-absolute-end group)))) - (unwind-protect (lambda () - (set! outside-writeable (group-writeable? group)) - (set! outside-start (group-start-mark group)) - (set! outside-end (group-end-mark group)) - (set-group-writeable?! group inside-writeable) - (set-group-start-mark! group inside-start) - (set-group-end-mark! group inside-end)) - thunk - (lambda () - (set! inside-writeable (group-writeable? group)) - (set! inside-start (group-start-mark group)) - (set! inside-end (group-end-mark group)) - (set-group-writeable?! group outside-writeable) - (set-group-start-mark! group outside-start) - (set-group-end-mark! group outside-end))))) + (dynamic-wind (lambda () + (set! outside-writeable (group-writeable? group)) + (set! outside-start (group-start-mark group)) + (set! outside-end (group-end-mark group)) + (set-group-writeable?! group inside-writeable) + (set-group-start-mark! group inside-start) + (set-group-end-mark! group inside-end)) + thunk + (lambda () + (set! inside-writeable (group-writeable? group)) + (set! inside-start (group-start-mark group)) + (set! inside-end (group-end-mark group)) + (set-group-writeable?! group outside-writeable) + (set-group-start-mark! group outside-start) + (set-group-end-mark! group outside-end))))) ;;;; Constants diff --git a/v7/src/edwin/struct.scm b/v7/src/edwin/struct.scm index af222849c..54d5efd72 100644 --- a/v7/src/edwin/struct.scm +++ b/v7/src/edwin/struct.scm @@ -1,25 +1,27 @@ -;;; -*-Scheme-*- -;;; -;;; $Id: struct.scm,v 1.96 2002/11/20 19:46:03 cph Exp $ -;;; -;;; Copyright (c) 1985, 1989-2001 Massachusetts Institute of Technology -;;; -;;; This file is part of MIT Scheme. -;;; -;;; MIT Scheme is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation; either version 2 of the License, -;;; or (at your option) any later version. -;;; -;;; MIT Scheme is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with MIT Scheme; if not, write to the Free Software -;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -;;; 02111-1307, USA. +#| -*-Scheme-*- + +$Id: struct.scm,v 1.97 2003/01/10 20:25:05 cph Exp $ + +Copyright 1985,1989,1990,1991,1992,1993 Massachusetts Institute of Technology +Copyright 1994,1999,2000,2001,2003 Massachusetts Institute of Technology + +This file is part of MIT Scheme. + +MIT Scheme is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +MIT Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT Scheme; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +|# ;;;; Text Data Structures @@ -220,17 +222,17 @@ (old-text-end) (new-text-start (make-permanent-mark group start #f)) (new-text-end (make-permanent-mark group end #t))) - (unwind-protect (lambda () - (set! old-text-start (group-start-mark group)) - (set! old-text-end (group-end-mark group)) - (set-group-start-mark! group new-text-start) - (set-group-end-mark! group new-text-end)) - thunk - (lambda () - (set! new-text-start (group-start-mark group)) - (set! new-text-end (group-end-mark group)) - (set-group-start-mark! group old-text-start) - (set-group-end-mark! group old-text-end))))) + (dynamic-wind (lambda () + (set! old-text-start (group-start-mark group)) + (set! old-text-end (group-end-mark group)) + (set-group-start-mark! group new-text-start) + (set-group-end-mark! group new-text-end)) + thunk + (lambda () + (set! new-text-start (group-start-mark group)) + (set! new-text-end (group-end-mark group)) + (set-group-start-mark! group old-text-start) + (set-group-end-mark! group old-text-end))))) (define (group-text-clip group start end) (let ((start (make-permanent-mark group start #f))