#| -*-Scheme-*-
-$Id: editor.scm,v 1.259 2004/02/16 05:43:21 cph Exp $
+$Id: editor.scm,v 1.260 2005/12/09 07:06:23 riastradh Exp $
Copyright 1986,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
(define null-output-port
(make-port (make-port-type
- `((WRITE-CHAR ,(lambda (port char) port char unspecific)))
+ `((WRITE-CHAR ,(lambda (port char)
+ port char
+ ;; Return the number of characters written.
+ 1)))
#f)
#f))
#| -*-Scheme-*-
-$Id: genio.scm,v 1.33 2005/11/29 06:41:45 cph Exp $
+$Id: genio.scm,v 1.34 2005/12/09 07:06:23 riastradh Exp $
Copyright 1991,1993,1995,1996,1999,2002 Massachusetts Institute of Technology
Copyright 2003,2004,2005 Massachusetts Institute of Technology
(be (min page-size (- end start))))
(let ((n (read-to-8-bit ib bounce 0 be)))
(if (and n (fix:> n 0))
- (substring-move! bounce 0 n string start))
+ (xsubstring-move! bounce 0 n string start))
n))))
(define (input-buffer-in-8-bit-mode? ib)
#| -*-Scheme-*-
-$Id: port.scm,v 1.38 2005/10/24 01:45:41 cph Exp $
+$Id: port.scm,v 1.39 2005/12/09 07:06:23 riastradh Exp $
Copyright 1991,1992,1993,1994,1997,1999 Massachusetts Institute of Technology
Copyright 2001,2002,2003,2004,2005 Massachusetts Institute of Technology
(set-port/unread! port #f)
1)
(let ((n (defer port string start end)))
- (transcribe-substring string start (fix:+ start n) port)
+ (if (and n (fix:> n 0))
+ (transcribe-substring string start (fix:+ start n)
+ port))
n)))))
(read-wide-substring
(let ((defer (op 'READ-WIDE-SUBSTRING)))
(set-port/unread! port #f)
1)
(let ((n (defer port string start end)))
- (transcribe-substring string start (+ start n) port)
+ (if (and n (fix:> n 0))
+ (transcribe-substring string start (+ start n) port))
n))))))
(lambda (name)
(case name
(begin
(set-port/previous!
port
- (string-ref string (fix:+ start (fix:- n 1))))
+ (wide-string-ref string (fix:+ start (fix:- n 1))))
(transcribe-substring string start (fix:+ start n) port)))
n))))
(write-external-substring
#| -*-Scheme-*-
-$Id: unicode.scm,v 1.23 2005/05/30 04:10:47 cph Exp $
+$Id: unicode.scm,v 1.24 2005/12/09 07:06:23 riastradh Exp $
Copyright 2001,2003,2004,2005 Massachusetts Institute of Technology
`((WRITE-CHAR
,(lambda (port char)
(guarantee-wide-char char 'WRITE-CHAR)
- ((port/state port) char)))
+ ((port/state port) char)
+ ;; Return the number of characters written.
+ 1))
(EXTRACT-OUTPUT
,(lambda (port)
(%make-wide-string