-;;; -*-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
(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)))
#| -*-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.
(mark (current-mark)))
(let ((swap? (mark< point mark))
(temp))
- (unwind-protect
+ (dynamic-wind
(lambda ()
(set! temp (temporary-buffer " *shell-output*"))
unspecific)
#| -*-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.
(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)
#| -*-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
(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)
#| -*-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
(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)
-;;; -*-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
(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)
-;;; -*-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)
(mark (current-mark)))
(let ((swap? (mark< point mark))
(temp))
- (unwind-protect
+ (dynamic-wind
(lambda ()
(set! temp (temporary-buffer " *shell-output*"))
unspecific)
-;;; -*-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
(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)))))
\f
(define (replace-match replacement #!optional preserve-case? literal?)
(let ((start (re-match-start 0))
-;;; -*-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
(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))
-;;; -*-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
(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)))))
\f
;;;; Constants
-;;; -*-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
(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))