#| -*-Scheme-*-
-$Id: edwin.pkg,v 1.168 1995/04/15 06:48:48 cph Exp $
+$Id: edwin.pkg,v 1.169 1995/04/17 21:46:25 cph Exp $
Copyright (c) 1989-95 Massachusetts Institute of Technology
group-extract-and-delete-string!
group-extract-string
group-insert-char!
+ group-insert-chars!
group-insert-string!
group-insert-substring!
group-left-char
;;; -*-Scheme-*-
;;;
-;;; $Id: grpops.scm,v 1.21 1993/08/13 23:20:39 cph Exp $
+;;; $Id: grpops.scm,v 1.22 1995/04/17 21:46:10 cph Exp $
;;;
-;;; Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology
;;;
;;; This material was developed by the Scheme project at the
;;; Massachusetts Institute of Technology, Department of
;;;; Insertions
(define (group-insert-char! group index char)
+ (group-insert-chars! group index char 1))
+
+(define (group-insert-chars! group index char n)
(let ((interrupt-mask (set-interrupt-enables! interrupt-mask/gc-ok)))
- (prepare-gap-for-insert! group index 1)
- (string-set! (group-text group) index char)
- (finish-group-insert! group index 1)
+ (prepare-gap-for-insert! group index n)
+ (let ((text (group-text group))
+ (end (fix:+ index n)))
+ (do ((index index (fix:+ index 1)))
+ ((fix:= index end))
+ (string-set! text index char)))
+ (finish-group-insert! group index n)
(set-interrupt-enables! interrupt-mask)
unspecific))
(finish-group-insert! group index n))
(set-interrupt-enables! interrupt-mask)
unspecific))
-
+\f
(define (prepare-gap-for-insert! group new-start n)
(if (or (group-read-only? group)
(and (group-text-properties group)