From: Chris Hanson Date: Thu, 31 Mar 2005 18:59:05 +0000 (+0000) Subject: Extend ->BUFFER to accept regions too. X-Git-Tag: 20090517-FFI~1338 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=053b88df72127ca1b043a2710feafed94a587501;p=mit-scheme.git Extend ->BUFFER to accept regions too. --- diff --git a/v7/src/edwin/buffer.scm b/v7/src/edwin/buffer.scm index fcd2d285f..cda0df325 100644 --- a/v7/src/edwin/buffer.scm +++ b/v7/src/edwin/buffer.scm @@ -1,10 +1,10 @@ #| -*-Scheme-*- -$Id: buffer.scm,v 1.190 2003/02/14 18:28:11 cph Exp $ +$Id: buffer.scm,v 1.191 2005/03/31 18:59:05 cph Exp $ Copyright 1986,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1998,1999,2000 Massachusetts Institute of Technology -Copyright 2001,2002,2003 Massachusetts Institute of Technology +Copyright 2001,2002,2003,2005 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -243,11 +243,13 @@ The buffer is guaranteed to be deselected at that time." (set-buffer-alist! buffer (del-assq! key (buffer-alist buffer)))) (define (->buffer object) - (cond ((buffer? object) object) - ((and (mark? object) (mark-buffer object))) - ((and (group? object) (group-buffer object))) - ((window? object) (window-buffer object)) - (else (error "can't coerce to buffer:" object)))) + (or (cond ((buffer? object) object) + ((mark? object) (mark-buffer object)) + ((group? object) (group-buffer object)) + ((region? object) (mark-buffer (region-start object))) + ((window? object) (window-buffer object)) + (else (error:wrong-type-argument object "buffer" '->BUFFER))) + (error:bad-range-argument object '->BUFFER))) ;;;; Modification Flags